Skip to content

Instantly share code, notes, and snippets.

@etshy
Created July 25, 2024 15:41
Show Gist options
  • Save etshy/b15effcc752cdd66fc3e3026daf3705d to your computer and use it in GitHub Desktop.
Save etshy/b15effcc752cdd66fc3e3026daf3705d to your computer and use it in GitHub Desktop.
minimal-openapi-js-generation-issue
{
"openapi": "3.0.0",
"info": {
"title": "XXX",
"description": "XXX",
"version": "0.0.1"
},
"servers": [
{
"url": "http:\/\/localhost"
}
],
"paths": {
"/user/{id}/things": {
"post": {
"tags": [
"Users"
],
"operationId": "addThings",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"pattern": "[1-9]\\d*"
}
}
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"$ref": "#\/components\/schemas\/AddThingsCommand"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application\/json": {
"schema": {
"$ref": "#\/components\/schemas\/AddThingsCommandResponse"
}
}
}
},
"404": {
"description": "Not found"
}
},
"security": [
{
"Bearer": []
}
]
}
}
},
"components": {
"schemas": {
"AddThingsCommand": {
"properties": {
"things": {
"nullable": true,
"oneOf": [
{
"$ref": "#\/components\/schemas\/ThingDto"
}
]
},
"id": {
"type": "string",
"default": ""
}
},
"type": "object"
},
"AddThingsCommandResponse": {
"properties": {
"createdAt": {
"type": "string",
"format": "date-time",
"nullable": true
},
"id": {
"type": "string",
"default": ""
}
},
"type": "object"
},
"ThingDto": {
"properties": {
"property1": {
"type": "string"
},
"property2": {
"type": "string"
},
"subThing": {
"nullable": true,
"oneOf": [
{
"$ref": "#/components/schemas/SubThingDto"
}
]
}
},
"type": "object"
},
"SubThingDto": {
"properties": {
"id": {
"type": "integer",
"nullable": true
}
},
"type": "object"
}
},
"securitySchemes": {
"Bearer": {
"type": "http",
"scheme": "bearer"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment