-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with generation Java-Code with new 1.4 Release #495
Comments
I will find a link to an alternative generator that could be investigated. If there is no solution after a few weeks we may need to revert to OpenAPI 3.0.1 |
In my opinion, the code generator works correctly. As I understood from various sources, including https://learn.openapis.org/referencing/overview.html, the functionality of For example, the json object { "$ref": "../types/icarIdentifierType.json" } will be replaced completely by the json object defined in the referenced file. This means that all references of this kind are now represented as inline objects, which is exactly what we see: no more inheritance and class names that are automatically assigned by the generator. Since this is part of the basic parsing of the specification files, this is not a generator-specific behavior; as a test, we have tested other generators and see the same issue. Using a "title" definition for each reference only partially solves the problem: although the corresponding generated classes are then usually named correctly, this does not restore the hierarchy of the data structure. And about naming: Since each reference to the same specification file is rendered as an individual inline object, the generator adds suffixes to each occurrence in order to avoid naming conflicts of the generated classes. However, using the existing tools to merge spec files did not lead to a solution either. So we have written our own script for that purpose. The resulting specification file then leads to all classes, including inheritance and correct naming. We tested our solution with code generator version 7.9.0-SNAPSHOT. |
Together with Daniel (@damare), we discovered that combining the distributed OpenAPI specification, which is spread across multiple files, into a single file ensures that code generation works as expected. The tools which we used to generate schema file:
There are several ways to ensure that all partners generate the code consistently:
|
Agreed at the meeting Nov 28 2024:
|
As mentioned in https://github.com/OpenAPITools/openapi-generator#11---compatibility the OpenAPI Spec 3.1 is still im beta.
We run into problems best summed up in OpenAPITools/openapi-generator#18686 .
The inheritance gets not generated correctly.
The text was updated successfully, but these errors were encountered: