Open sumedha0203 opened 2 years ago
openapi-generator for java is not able to generate class for oneOf field
/Users/....../CustomClass.java:[23,41] cannot find symbol [ERROR] symbol: class OneOfstringinteger
CustomClass.java class is created with the field
public static final String SERIALIZED_NAME_FIELD_VALUE = "fieldValue"; @SerializedName(SERIALIZED_NAME_FIELD_VALUE) private OneOfstringinteger fieldValue = null;
But OneOfstringinteger is not getting created.
fieldValue: oneOf: - type: string - type: integer
mvn clean install takes care of it
mvn clean install
trying to build the project by maven command
open-api generator for java is not able to generate a class for oneOf type for primitive objects (string, integer, number etc).
tried with objects also but same error came:
fieldValue: oneOf: - $ref: '#/definitions/StringValue' - $ref: '#/definitions/NumberValue' definitions: StringValue: type: object properties: name: type: string NumberValue: type: object properties: name: type: number
cannot find symbol [ERROR] symbol: class OneOfStringValueNumberValue
I am facing a similar issue https://stackoverflow.com/questions/72043299/swagger-openapi-code-gen-oneof-how-to-generate-correct-class-file
https://community.smartbear.com/t5/AlertSite-Feature-Requests/Retrieve-AlertSite-Usage-Statistics-via-API/idi-p/197405
Description
openapi-generator for java is not able to generate class for oneOf field
/Users/....../CustomClass.java:[23,41] cannot find symbol [ERROR] symbol: class OneOfstringinteger
CustomClass.java class is created with the field
public static final String SERIALIZED_NAME_FIELD_VALUE = "fieldValue"; @SerializedName(SERIALIZED_NAME_FIELD_VALUE) private OneOfstringinteger fieldValue = null;
But OneOfstringinteger is not getting created.
Swagger-codegen version
Swagger declaration file content or url
Command line used for generation
mvn clean install
takes care of itSteps to reproduce
trying to build the project by maven command
Related issues/PRs
Suggest a fix/enhancement
open-api generator for java is not able to generate a class for oneOf type for primitive objects (string, integer, number etc).
tried with objects also but same error came: