elements
elements copied to clipboard
The order of oneOf-objects in allOff-array is reversed.
Summary
When there are oneOf-objects in allOff-array, the order is reversed.

Tasks
- [ ] The order of oneOf-objects should be not be reversed.
- [ ] The position of oneOf-objects should be not always be at the bottom.
Thanks very much.
The source code:
{
"openapi": "3.1.0",
"info": {
"title": "demo",
"version": "1.0"
},
"servers": [
{
"url": "http://localhost:3000"
}
],
"paths": {
"/user": {
"post": {
"summary": "Create New User",
"operationId": "post-user",
"description": "Create a new user.",
"requestBody": {
"content": {
"application/json": {
"schema": {
"allOf": [
{
"oneOf": [
{
"$ref": "#/components/schemas/Name-Common"
},
{
"$ref": "#/components/schemas/Name-Simple"
}
]
},
{
"oneOf": [
{
"$ref": "#/components/schemas/Address-Common"
},
{
"$ref": "#/components/schemas/Address-Singapore"
}
]
},
{
"type": "object",
"properties": {
"gendor": {
"type": "string"
},
"birthday": {
"type": "string"
}
}
}
]
}
}
}
}
}
}
},
"components": {
"schemas": {
"Name-Common": {
"title": "Name-Common",
"type": "object",
"properties": {
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
}
}
},
"Name-Simple": {
"title": "Name-Simple",
"type": "object",
"properties": {
"full_name": {
"type": "string"
}
}
},
"Address-Common": {
"title": "Address-Common",
"type": "object",
"properties": {
"state": {
"type": "string"
},
"city": {
"type": "string"
},
"detail": {
"type": "string"
}
}
},
"Address-Singapore": {
"title": "Address-Singapore",
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}