-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Related: #4290 (comment)
Currently, the filter schemas are generated inline in the OAS openapi.json document. This may lead to the filter schemas being repeated within the same OAS docs.
Suggestion
Instead, these schemas should be refactored into /components/schemas.
Use Cases
The OAS document may be more compact and have increased readability as the filter schemas will not be repeated. Furthermore, the generated client-side code may also benefit similarly.
Examples
(Taken from: #4290 (comment))
{
"TodoFields": {
"title": "TodoFields",
"type": "object",
"properties": {
"id": {
"type": "boolean"
}
// ...
}
},
"TodoFilter": {
"title": "TodoFilter",
"type": "object",
"properties": {
"where": {
"type": "object"
},
"fields": {
"$ref": "#/components/schemas/TodoFields"
},
"offset": {
"minimum": 0,
"type": "integer",
"format": "int32"
},
"limit": {
"minimum": 1,
"type": "integer",
"format": "int32",
"example": 100
},
"skip": {
"minimum": 0,
"type": "integer",
"format": "int32"
},
"order": {
"type": "array",
"items": {
"type": "string"
},
"description": ""
},
"include": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Include"
},
"description": ""
}
}
}
Acceptance criteria
TBD - will be filled by the team.