Open skiarn opened 2 years ago
I noticed a change while using docker image openapitools/openapi-generator-cli:v5.2.1 => openapitools/openapi-generator-cli:v5.3.0.
What is expected behaviour? In docker image version 5.3.0 I want to generate following code State *ExampleState `json:"state,omitempty"
State *ExampleState `json:"state,omitempty"
openapitools/openapi-generator-cli:v5.2.1 vs openapitools/openapi-generator-cli:v5.3.0
openapi: 3.0.0 info: title: Example version: '0.1' description: |- servers: - url: 'https://example.com' description: prod paths: /example: get: operationId: example summary: example description: GO *pointers behaves differently, models is different between versions responses: '200': $ref: '#/components/responses/ExampleResponse' components: schemas: Example: title: Example type: object description: '' properties: id: type: string format: uuid readOnly: true description: '' state: readOnly: true allOf: - $ref: '#/components/schemas/ExampleState' required: - id ExampleState: title: ExampleState type: string description: '' enum: - A - B - C responses: ExampleResponse: description: A list of examples content: application/json: schema: title: Examples type: object description: Response structure of the list examples request properties: examples: type: array items: $ref: '#/components/schemas/Example' Example: description: Example response content: application/json: schema: $ref: '#/components/schemas/Example'
docker run --rm \ --volume "/Users/xx/openapi-generator-cli:/local" \ --user "1001:121" \ openapitools/openapi-generator-cli:v5.2.1 \ generate \ --input-spec /local/openapi.yaml \ --global-property models,modelDocs=false \ --generator-name go \ --additional-properties packageName=models \ --output /local/models
v5.2.1 Generate: // Example struct for Example type Example struct { Id string json:"id" State *ExampleState json:"state,omitempty" }
json:"id"
json:"state,omitempty"
docker run --rm \ --volume "/Users/xx/openapi-generator-cli:/local" \ --user "1001:121" \ openapitools/openapi-generator-cli:v5.3.0 \ generate \ --input-spec /local/openapi.yaml \ --global-property models,modelDocs=false \ --generator-name go \ --additional-properties packageName=models \ --output /local/models
v5.3.0 Generate: // Example struct for Example type Example struct { Id string json:"id" State ExampleState json:"state,omitempty" }
Any updates on this? is there a workaround?
Could you check the versions? My case is the following:
btw it is so unbelievable that there is no at least a simple test that will generate API and compile it.
Bug Report Checklist
Description
I noticed a change while using docker image openapitools/openapi-generator-cli:v5.2.1 => openapitools/openapi-generator-cli:v5.3.0.
What is expected behaviour? In docker image version 5.3.0 I want to generate following code
State *ExampleState `json:"state,omitempty"
openapi-generator version
openapitools/openapi-generator-cli:v5.2.1 vs openapitools/openapi-generator-cli:v5.3.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
docker run --rm \ --volume "/Users/xx/openapi-generator-cli:/local" \ --user "1001:121" \ openapitools/openapi-generator-cli:v5.2.1 \ generate \ --input-spec /local/openapi.yaml \ --global-property models,modelDocs=false \ --generator-name go \ --additional-properties packageName=models \ --output /local/models
v5.2.1 Generate: // Example struct for Example type Example struct { Id string
json:"id"
State *ExampleStatejson:"state,omitempty"
}docker run --rm \ --volume "/Users/xx/openapi-generator-cli:/local" \ --user "1001:121" \ openapitools/openapi-generator-cli:v5.3.0 \ generate \ --input-spec /local/openapi.yaml \ --global-property models,modelDocs=false \ --generator-name go \ --additional-properties packageName=models \ --output /local/models
v5.3.0 Generate: // Example struct for Example type Example struct { Id string
json:"id"
State ExampleStatejson:"state,omitempty"
}Suggest a fix