feat: Support OpenAPI 3.1.x - #1231
Conversation
CharlesDuboisSAP
left a comment
There was a problem hiding this comment.
Some test coverage is lacking, you could add some more unit tests
| { | ||
| return isOas31(rootNode.path("openapi").asText(null)); | ||
| final String version = openAPI.getOpenapi(); | ||
| return version != null && version.startsWith("3.1"); |
There was a problem hiding this comment.
Shouldn’t it be version >= 3.1 ?
There was a problem hiding this comment.
It is hard to say >= 3.1 as they don't follow SemVer any more since 3.1. So there can be breaking changes in 3.2 and it should have an additional isOas32 to control the process logic.
So what is true in 3.1 may not be true in 3.2. As for now, I would suggest we just announce support for 3.1 and say 3.2 not supported.
…k-java into support-openapi-3.1
There was a problem hiding this comment.
Overall LGTM, one small thing:
Why did you duplicate all integrations tests in DataModelGeneratorApacheIntegrationTest? I would remove them since they are already tested in DataModelGeneratorIntegrationTest, and they cover the same lines of code, apache only changes the inside of the Api class which are not the point of your tests anyway.
|
@CharlesDuboisSAP @Jonas-Isr Can you add a simple release note for this? I don't know how you do this normally in Java team. |
|
I added a log warning for 3.1 to point out that this is an experimental feature. We can remove this after a while. |
Context
This is a generated (later manually reviewed and fixed) PoC for evaluating the effort of supporting OpenAPI 3.1.x in the generator.
The following two files coming from the initial round of generation might be outdated but you can use as a reference.
I generated all data models in AI SDK Java with the new SNAPSHOT cloud sdk generator, and there were no breaking changes.
See SAP/ai-sdk-java#958 for the generated result.