Skip to content

Instantly share code, notes, and snippets.

@gunzip
Created September 18, 2025 16:24
Show Gist options
  • Save gunzip/ae9542ccb5b1cd38466ca5afecc864a2 to your computer and use it in GitHub Desktop.
Save gunzip/ae9542ccb5b1cd38466ca5afecc864a2 to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.1",
"info": {
"title": "Minimal API",
"version": "1.0.0"
},
"paths": {
"/object": {
"get": {
"summary": "Get Objects",
"description": "Get a list of Objects filtered by class and/or name query parameters",
"operationId": "getObjects",
"parameters": [
{
"name": "class",
"in": "query",
"description": "Filter objects by class",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "name",
"in": "query",
"description": "Filter objects by name",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"$ref": "#/components/responses/ObjectList"
},
"400": {
"$ref": "#/components/responses/BadRequest"
}
}
}
}
},
"components": {
"schemas": {
"Object": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"description": "Unique identifier for the object"
},
"name": {
"type": "string",
"description": "Name of the object"
},
"class": {
"type": "string",
"description": "Class of the object"
}
},
"required": ["id", "name", "class"]
},
"ObjectList": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Object"
},
"description": "List of Objects matching the query criteria"
},
"Error": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message"
},
"code": {
"type": "integer",
"description": "Error code"
}
},
"required": ["error"]
}
},
"responses": {
"ObjectList": {
"description": "List of Objects matching the query criteria",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ObjectList"
}
}
}
},
"BadRequest": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment