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

Update SmallRye OpenAPI and MicroProfile OpenAPI to 4.0 #44055

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

MikeEdgar
Copy link
Contributor

@MikeEdgar MikeEdgar commented Oct 23, 2024

  • Bumps MicroProfile OpenAPI to 4.0.2 (breaking API changes)
  • Bumps SmallRye OpenAPI to 4.0.0
  • Replace uses of SmallRye OpenAPI's internal model types with OASFactory
  • Move calculation of operation method reference into OpenAPI processor and combine two Operation filters into single filter to make a single pass over the OpenAPI model.

@quarkus-bot quarkus-bot bot added area/dependencies Pull requests that update a dependency file area/health area/openapi area/smallrye labels Oct 23, 2024
@MikeEdgar
Copy link
Contributor Author

@zakkak, you should see further reduction in the native image size with this update.

bom/application/pom.xml Outdated Show resolved Hide resolved
@zakkak
Copy link
Contributor

zakkak commented Oct 24, 2024

For reference, this PR is related to #43616 and #41037.

@zakkak, you should see further reduction in the native image size with this update.

The mentioned reduction in the native image size refers to #41037 (comment) and how #43616 reverted some of that effect.

@MikeEdgar MikeEdgar marked this pull request as ready for review October 25, 2024 14:17
@MikeEdgar
Copy link
Contributor Author

I'm looking into the integration test failure.

This comment has been minimized.

This comment has been minimized.

@quarkus-bot quarkus-bot bot added the area/spring Issues relating to the Spring integration label Oct 26, 2024

This comment has been minimized.

- OAS 3.1, normalize `type` to arrays, do not test order of health keys
- Fix health schema type tests
- Update Spring Web test for OAS 3.1

Signed-off-by: Michael Edgar <[email protected]>
@MikeEdgar
Copy link
Contributor Author

@phillip-kruger please take a look when you can, thanks.

Copy link
Member

@phillip-kruger phillip-kruger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice ! Thanks @MikeEdgar !

@zakkak
Copy link
Contributor

zakkak commented Oct 30, 2024

@zakkak, you should see further reduction in the native image size with this update.

Indeed, I see:

Before After Diff (%)
Reachable classes 13680 13421 1.9
Reachable methods 70690 69608 1.5
Size (MB) 63.6 63.1 0.7

@gsmet gsmet merged commit 3995d71 into quarkusio:main Oct 30, 2024
50 of 51 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.17 - main milestone Oct 30, 2024
@MikeEdgar MikeEdgar deleted the smallrye-openapi-4.0 branch October 30, 2024 13:44
@michalvavrik
Copy link
Member

michalvavrik commented Oct 31, 2024

Hello, this PR has in description breaking changes but there is no label and there isn't a migration guide note. For example, JSON path to one of my example in schema was components.schemas.LocalDateTime.example and now it is components.schemas.LocalDateTime.examples[0]. This may impact generated clients, ETLs etc. and users need to know about breaking changes. @MikeEdgar can you document this, please? If you cannot add migration guides, I am sure @gsmet or @phillip-kruger can help.

@MikeEdgar
Copy link
Contributor Author

@MikeEdgar can you document this, please?

@michalvavrik can you point me to the repository where that should be done?

@michalvavrik
Copy link
Member

@MikeEdgar can you document this, please?

@michalvavrik can you point me to the repository where that should be done?

It's this one. I myself have no rights so better talk to @gsmet about the process.

@michalvavrik
Copy link
Member

I'll add a breaking label though. Hope that's fine.

@zakkak
Copy link
Contributor

zakkak commented Oct 31, 2024

@michalvavrik can you point me to the repository where that should be done?

@MikeEdgar the migration guide is here https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.17 , I don't know if you have edit rights through.

@gsmet
Copy link
Member

gsmet commented Oct 31, 2024

You can post something here and I'll add it.

@MikeEdgar
Copy link
Contributor Author

MikeEdgar commented Nov 4, 2024

@gsmet , @michalvavrik , here is some content for the 3.17 Migration guide.

MicroProfile OpenAPI 4.0

MicroProfile OpenAPI and the SmallRye OpenAPI implementation have both be updated to version 4. This version brings support for OpenAPI specification version 3.1. By default, the OpenAPI documentation generated will use version 3.1.0, however users can continue to generate 3.0.x output by using property mp.openapi.extensions.smallrye.openapi with (for example) the value 3.0.3.

The Schema interface contains breaking changes, specifically:

  • type property type changed from SchemaType to List<SchemaType>
  • exclusiveMinimum and exclusiveMaximum property types changed from Boolean to BigDecimal
  • nullable property removed (replaced by the addition of NULL to SchemaType)
  • property example is deprecated in favor of using the new examples property, which may hold one or more example objects

Additionally, the default value of @RequestBody.required has changed to true to reflect that this is the much more common case where a RESTful resource method accepts a request body.

There are numerous other new properties for annotations and models, reflecting the changes between OpenAPI 3.0.x and 3.1.0. The release notes for the latest MicroProfile OpenAPI 4 release are available for review.

@michalvavrik
Copy link
Member

thank you @MikeEdgar

@MikeEdgar
Copy link
Contributor Author

@gsmet just bumping this thread to make sure you got my comment with the 3.17 migration notes for OpenAPI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependencies Pull requests that update a dependency file area/health area/openapi area/smallrye area/spring Issues relating to the Spring integration release/breaking-change triage/flaky-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants