Open jbx1 opened 3 years ago
I suspect that the reason is because the required: true was omitted for path parameters, but this was not an issue on the previous version 4.3.1. Anyway, it is incorrect to mark Path variables as not required.
That would be my guess as well due to changes in the swagger parser.
A workaround is to manually adding "required: true" to the path parameters, e.g. https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml#L168
Bug Report Checklist
Description
When generating the server code for Java Spring, for the attached YAML below with version 4.3.1 I get the correct output as follows:
However after upgrading to 5.3.0 the order of the parameters changed. Since they were all strings, it still compiled, but caused the incorrect parameter values to be passed to the class implementing the API interface generated.
Somehow, even though the parameters are path parameters, they still were marked as optional. Path parameters are never optional.
Code generated with 5.3.0:
I suspect that the reason is because the
required: true
was omitted for path parameters, but this was not an issue on the previous version 4.3.1. Anyway, it is incorrect to mark Path variables as not required.openapi-generator version
5.3.0
Used to work well on 4.3.1.