-
Notifications
You must be signed in to change notification settings - Fork 90
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
Allow defining arrays with multiple types of items #1683
Comments
Hi @mklueh, I am a contributor to both projects. The SmallRye implementation of MP OpenAPI aims to follow the spec as closely as possible and of course pass the TCK tests. Generally, we avoid extending the API (adding annotations or new interfaces). Until the change is available in the MP OpenAPI spec to specify @Data
@Builder
@AllArgsConstructor
public class SomeResponseObject {
private long page;
private long pages;
@Schema(implementation = BaseClassSchema[].class)
private List<BaseClass> items;
@Schema(oneOf = { SomeItem.class, SomeOtherItem.class })
private static class BaseClassSchema { /* Schema marker class only */ }
} |
@MikeEdgar thanks for the clarification and the workaround :) I'll try that out |
@mklueh , you could of course place |
@MikeEdgar thank you, seems to work :) |
@mklueh would you be OK with closing this issue? We'll need to work in the spec project anyway to make the enhancements to the annotations that is being discussed there. |
@MikeEdgar sure 😊 |
Hello. I found this issue in the microprofile repository and participated there, as I`m missing a feature that should exist according to the specification:
using Schema with anyOf / oneOf / allOf
Which however, against expectations leads to this schema
which generates his typescript object
This is the current vs the expected result discussed here openapi-ts/openapi-typescript#1421 (comment):
The guys from Eclipse have provided multiple solution ideas like this
eclipse/microprofile-open-api#425 (comment)
which would apply the Schema to the Item(s) instead of the list property.
As the issue is already almost 4 years old and I'm not sure how the relation between the Eclipse and the Smallrye project is, I have doubts that a solution will find its way into the Quarkus ecosystem anytime soon. That's why I repost it here.
The text was updated successfully, but these errors were encountered: