You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our application we rely on Optional<...> for each of our models properties to allow us to distinguish between "undefined" vs. "null" vs. "an actual value". When generating OpenAPI all schemas are properly referenced except for array-like data structure.
For example, using WildFly 23.0.2.Final which bundle SmallRye OpenAPI 2.1.2:
@Path("/aresources")
public class AResource {
public static class A {
public UUID id;
public Optional<B> optionalOfB;
public List<B> listOfB;
public Optional<List<B>> optionalListOfB;
}
public static class B {
public UUID id;
}
@GET @Path("/") @Operation(summary = "List A")
public List<A> listA() {
return Collections.emptyList();
}
}
Hi there,
In our application we rely on Optional<...> for each of our models properties to allow us to distinguish between "undefined" vs. "null" vs. "an actual value". When generating OpenAPI all schemas are properly referenced except for array-like data structure.
For example, using WildFly 23.0.2.Final which bundle SmallRye OpenAPI 2.1.2:
will generate the following yaml (excerpt):
but should have instead:
I've also tested out the latest SmallRye OpenAPI 2.1.4, which had lead to the exact same result.
My guess is #210 does not cover this specific use case and/or there's an issue within the
io.smallrye.openapi.runtime.util.TypeUtil
.Let me know if I can be any help to resolve this issue; this is last one preventing us migrating from Swagger to OpenAPI.
Thank you!
The text was updated successfully, but these errors were encountered: