-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
bugfix: openapi code generator to consider schema changes #16735
bugfix: openapi code generator to consider schema changes #16735
Conversation
Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors. Let me know if you need help fixing it. |
…pikaSridhar2112/openapi-generator into bugfix/schemaChangeReflector
…pikaSridhar2112/openapi-generator into bugfix/schemaChangeReflector
…pikaSridhar2112/openapi-generator into bugfix/schemaChangeReflector
…pikaSridhar2112/openapi-generator into bugfix/schemaChangeReflector
Hi, |
thanks for the PR. would it be possible to add a test to cover the issue? tests can be found in modules/openapi-generator-gradle-plugin/src/test/kotlin/ |
...gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt
Outdated
Show resolved
Hide resolved
@wing328 We have been running into problems where we've split a large OpenAPI specification into numerous files, with a file for each object. These are all in various sub folders and pulled in using How would you suggest we add a test for this? I assume you already have tests covering how you import schemas via reference, and this change is around the Gradle caching when a change has been made after your first build. |
@wing328 what would you suggest we do for a test on this as requested? |
…enapitools/generator/gradle/plugin/tasks/GenerateTask.kt Co-authored-by: David Morris <[email protected]>
all tests passed via #19701 |
Issue description : OpenApi code generator fails to regenerate the classes when changes are made to schema specifications.
Analysis: Open Api code generator task, org.openapitools.generator.gradle.plugin.tasks.GenerateTask is present in openapi-generator-gradle-plugin-5.4.0.jar. It scans changes across parameters provided as inputs and determines if code has to be regenerated on invocation.If schema changes made directly in openapi.yml it detects the change and re-generates the code. However it isnt aware of the location of the schema files refered via reference($ref) tags. Hence the open api code generator doesn't detect changes made to schema files.
Resolution: Adding schema location as an parameter to GenerateTask.kt resolves the issue. The plugin when executed detects changes made to reference schema files