Skip to content
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

Moving to open api spec 3.1 #239

Closed
alamers opened this issue Aug 12, 2021 · 7 comments · Fixed by #438
Closed

Moving to open api spec 3.1 #239

alamers opened this issue Aug 12, 2021 · 7 comments · Fixed by #438
Assignees
Labels
agenda-next-meeting next-minor-release The issue is not scheduled for the current release, but planned for a release soon after that.

Comments

@alamers
Copy link
Collaborator

alamers commented Aug 12, 2021

Related to #214, the question pops up whether or not to move our spec to OpenAPi 3.1.

Two main questions on this topic:

  • Does this impact (runtime) backwards compatibility? (expectation: no)
  • What is our policy on following the OpenApi spec? What can our partners expect with regards to maintaining a stable tool stack?
@ahokkonen
Copy link
Contributor

ahokkonen commented Aug 12, 2021

Things to review for migration: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0

Also to notice - currently not all generators supports OAS3.1 so the migration should be considered carefully.

@alamers
Copy link
Collaborator Author

alamers commented Sep 9, 2021

As discussed in the meeting today, investigating will continue but we don't expect 3.1 to be used for the next version. Version 3.0 will be the openapi spec to use for now.

@alamers alamers added breaking Identifies a potential breaking change that will normally be deferred until the next major release. next-minor-release The issue is not scheduled for the current release, but planned for a release soon after that. and removed breaking Identifies a potential breaking change that will normally be deferred until the next major release. labels Sep 9, 2021
@cookeac
Copy link
Collaborator

cookeac commented Sep 23, 2021

The group members at a meeting on 23 Sep 2021 discussed a move to support OpenAPI 3.1
(release announcement here: https://www.openapis.org/blog/2021/02/18/openapi-specification-3-1-released)

Our policy will be to move to newer versions providing that there is tool chain support from the commonly used toolchains by implementers across the wider ICAR group.

At present we cannot move as we await open-api generator support for OpenAPI spec 3.1. In turn this depends on when swagger-parser Supports OAS 3.1.

@cookeac
Copy link
Collaborator

cookeac commented Nov 16, 2023

Discussed this with reference to #409 which would require OAS3.1
OAS3.1 is now fully supported by open-api generator and other tooling. It better supports the elements of JSON Schema, and better supports documentation and examples.

Recommended a move to support OAS 3.1 within the timeline of ADE 1.4, subject to checking the way that code generation, particularly of the change from nullable to a [null] type option, is handled in C# and Java.
@AlexeyHardCode and @AndreasSchultzGEA we hope you could test this with just one or two files in your code generation.

@cookeac cookeac changed the title consider moving to open api spec 3.1 Moving to open api spec 3.1 Dec 1, 2023
@cookeac
Copy link
Collaborator

cookeac commented Dec 1, 2023

Noted also that use of GeoJSON's geometry type in #430 would also require OpenAPI 3.1 as it uses a $schema and $id specification that is not supported in OpenAPI 3.0.

@AndreasSchultzGEA
Copy link
Collaborator

AndreasSchultzGEA commented Dec 18, 2023

In general, I managed to create the Java-DTOs from the JSON-definitions....
But I couldn't test them, because the interface-generation still makes trouble:

    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
[ERROR] Error resolving #/components/parameters/meta-modified-from
java.net.URISyntaxException: Illegal character in opaque part at index 2: C:\dev\DairyNet\dairybox-icar-provider/../public-icar-api/src/main/resources/icar-v1/url-schemes/feedURLScheme.json
    at java.net.URI$Parser.fail (URI.java:2976)
    at java.net.URI$Parser.checkChars (URI.java:3147)
    at java.net.URI$Parser.parse (URI.java:3183)
    at java.net.URI.<init> (URI.java:623)

This is from feedUrlScheme as input.

@cookeac
Copy link
Collaborator

cookeac commented Jan 24, 2024

I investigated the problem @AndreasSchultzGEA identified. TL;DR: It is a tooling problem on Windows.

It seems it is caused by a problem in swagger-parser-v3 handling Windows path names that are passed to it by openapi-generator (v6.5 to v7.2). The actual problem is how openapi-generator passes the input file spec to the parser, but it shows up when swagger-parser-v3 is used to handle recent JSON Schema files (not just OpenAPI 3.1, but OpenAPI 3.1 implies that recent JSON Schema parsing is needed).

There are two workarounds in the discussion of the issue here: OpenAPITools/openapi-generator#15202

  • Run it in a Linux container, as the problem is specific to Windows
  • Use a Maven plugin to quote the double-quote symbols in the input spec.

@cookeac cookeac linked a pull request Apr 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agenda-next-meeting next-minor-release The issue is not scheduled for the current release, but planned for a release soon after that.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants