Class OneOfImplementorAdditionalData
- java.lang.Object
-
- org.openapitools.codegen.utils.OneOfImplementorAdditionalData
-
public class OneOfImplementorAdditionalData extends Object
This class holds data to add to `oneOf` members. Let's consider this example:Foo: properties: x: oneOf: - $ref: "#/components/schemas/One - $ref: "#/components/schemas/Two y: type: string One: properties: z: type: string Two: properties: a: type: string
In codegens that use this mechanism, `Foo` will become an interface and `One` will become its implementing class. This class carries all data necessary to properly modify the implementing class model. Specifically:
* Interfaces that the implementing classes have to implement (in the example above, `One` and `Two` will implement `Foo`) * Properties that need to be added to implementing classes (as `Foo` is interface, the `y` property will get pushed to implementing classes `One` and `Two`) * Imports that need to be added to implementing classes (e.g. if type of property `y` needs a specific import, it needs to be added to `One` and `Two` because of the above point)
-
-
Constructor Summary
Constructors Constructor Description OneOfImplementorAdditionalData(String implementorName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFromInterfaceModel(CodegenModel cm, List<Map<String,String>> modelsImports)
Add data from a given CodegenModel that the oneOf implementor should implement.void
addToImplementor(CodegenConfig cc, CodegenModel implcm, List<Map<String,String>> implImports, boolean addInterfaceImports)
Adds stored data to given implementing modelString
toString()
-
-
-
Constructor Detail
-
OneOfImplementorAdditionalData
public OneOfImplementorAdditionalData(String implementorName)
-
-
Method Detail
-
addFromInterfaceModel
public void addFromInterfaceModel(CodegenModel cm, List<Map<String,String>> modelsImports)
Add data from a given CodegenModel that the oneOf implementor should implement. For example:- Parameters:
cm
- model that the implementor should implementmodelsImports
- imports of the given `cm`
-
addToImplementor
public void addToImplementor(CodegenConfig cc, CodegenModel implcm, List<Map<String,String>> implImports, boolean addInterfaceImports)
Adds stored data to given implementing model- Parameters:
cc
- CodegenConfig running this operationimplcm
- the implementing modelimplImports
- imports of the implementing modeladdInterfaceImports
- whether or not to add the interface model as import (will vary by language)
-
-