smallrye-open-api icon indicating copy to clipboard operation
smallrye-open-api copied to clipboard

OAS 3.1 changes for schema model

Open Azquelt opened this issue 10 months ago • 2 comments

Implements the spec changes in eclipse/microprofile-open-api#598

Azquelt avatar Apr 09 '24 11:04 Azquelt

Build failures are expected because this depends on spec changes.

Locally I have tests passing up to this point:

SmallRye: OpenAPI Test Data ........................ FAILURE [ 10.751 s]

With the failure:

[ERROR] 	[error]: Build step io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor#build threw an exception: java.lang.NoSuchFieldError: org/eclipse/microprofile/openapi/models/media/Schema$SchemaType.NULL
[ERROR] 	at io.smallrye.openapi.api.models.media.SchemaImpl.setNullable(SchemaImpl.java:330)
[ERROR] 	at io.smallrye.openapi.runtime.io.schema.SchemaFactory.readSchema(SchemaFactory.java:188)
[ERROR] 	at io.smallrye.openapi.runtime.io.schema.SchemaFactory.readSchema(SchemaFactory.java:119)
[ERROR] 	at io.smallrye.openapi.runtime.io.schema.SchemaFactory.readSchema(SchemaFactory.java:94)
[ERROR] 	at io.smallrye.openapi.runtime.scanner.OpenApiDataObjectScanner.readKlass(OpenApiDataObjectScanner.java:376)
[ERROR] 	at io.smallrye.openapi.runtime.scanner.OpenApiDataObjectScanner.depthFirstGraphSearch(OpenApiDataObjectScanner.java:251)

which looks like this part of the build is running with the built smallrye-open-api, but using an older version of the spec APIs without SchemaType.NULL.

Azquelt avatar Apr 09 '24 11:04 Azquelt

Found the issue and updated the dependency for the testdata project and now my local build runs cleanly.

Azquelt avatar Apr 09 '24 12:04 Azquelt

@Azquelt I've updated the target branch to main-4.0

MikeEdgar avatar Apr 10 '24 11:04 MikeEdgar

@Azquelt , the target branch did not have CI enabled, so I've added it. We should get the test jobs running against the SNAPSHOT MP OpenAPI 4.0 build on your next rebase/push.

MikeEdgar avatar Apr 23 '24 18:04 MikeEdgar

I've updated the serialization code so that all the "xxxIO" objects are created and owned by IOContext and implemented the serialization of any model object as a child of a schema.

Unfortunately I found some mistakes in the tests in this area which are fixed by eclipse/microprofile-open-api#602. The code in this PR should pass all tests once that PR is merged.

Azquelt avatar Apr 25 '24 14:04 Azquelt

@Azquelt I just fast-forwarded main-4.0 to the current main. There are conflicts, but nothing looks terrible.

MikeEdgar avatar May 01 '24 11:05 MikeEdgar

@MikeEdgar Thanks, I'll have a look

Azquelt avatar May 01 '24 12:05 Azquelt

@MikeEdgar I've rebased this on the updated main-4.0 branch to resolve the conflicts and I think it's ready for review

Azquelt avatar May 03 '24 10:05 Azquelt

Let go, we can roll forward. Would this cause a breaking change in Quarkus, or is it backwards compatible ?

phillip-kruger avatar May 07 '24 00:05 phillip-kruger

Let go, we can roll forward. Would this cause a breaking change in Quarkus, or is it backwards compatible ?

This and other MP OpenAPI changes are going into the main-4.0 branch for now, so we won't release that until everything is completed and we'll bump the major version at that point.

MikeEdgar avatar May 07 '24 09:05 MikeEdgar

Just branch of current main into a tag for in case we need to do work on that branch.

phillip-kruger avatar May 07 '24 10:05 phillip-kruger