Closed as not planned
Closed as not planned
Description
Description
Array type of response object does not result in array type in schema
"SomeResponseObject" : {
"type" : "object",
"properties" : {
"page" : {
"format" : "int64",
"type" : "integer"
},
"pages" : {
"format" : "int64",
"type" : "integer"
},
"items" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/ResponseListItem"
},
"oneOf" : [ {
"$ref" : "#/components/schemas/SomeItem"
}, {
"$ref" : "#/components/schemas/SomeOtherItem"
} ]
}
}
},
will result in
SomeResponseObject: {
/** Format: int64 */
page?: number;
/** Format: int64 */
pages?: number;
items?: components["schemas"]["SomeItem"] | components["schemas"]["SomeOtherItem"];
};
Which does not represent the array but just a single item.
I've run Redocly and there are some issues, but nothing related to the object I'm referring to.
BTW the openapi.json / yaml is autogenerated by my Quarkus Application and this is the originating Java class:
@Data
@Builder
@AllArgsConstructor
public class SomeResponseObject {
private long page;
private long pages;
@Schema(type = ARRAY, oneOf = {SomeItem.class, SomeOtherItem.class})
private List<ResponseListItemDto> items;
}
I'm using
✨ openapi-typescript 6.7.0
Expected result
(in case it’s not obvious)
Checklist
- My OpenAPI schema passes the Redocly validator (
npx @redocly/cli@latest lint
) - I’m willing to open a PR (see CONTRIBUTING.md)