Files
koi_swagger_parser/test/fixtures/e2e_openapi.json
T
mr.koi 454e6c51d7 Release 0.2.0
Complete OpenAPI 3.0/3.1 generation, diagnostics, lifecycle safety, enum and naming mappings, bilingual documentation, examples, and pub.dev release validation.
2026-07-31 16:47:39 +08:00

229 lines
4.9 KiB
JSON

{
"openapi": "3.1.0",
"info": {
"title": "Koi generated package verification",
"version": "1.0.0"
},
"paths": {
"/api/v1/accounts/{segments}": {
"post": {
"tags": ["accounts"],
"operationId": "create_account",
"parameters": [
{
"name": "segments",
"in": "path",
"required": true,
"style": "label",
"explode": true,
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"name": "fields",
"in": "query",
"style": "pipeDelimited",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"name": "session",
"in": "cookie",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Account"
}
}
}
},
"responses": {
"200": {
"description": "created",
"headers": {
"X-Request-Id": {
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Account"
}
}
}
}
}
}
},
"/api/v1/unions": {
"get": {
"tags": ["unions"],
"operationId": "get_union",
"responses": {
"200": {
"description": "union",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnionEnvelope"
}
}
}
}
}
}
},
"/api/v1/download": {
"get": {
"tags": ["files"],
"operationId": "download_file",
"responses": {
"200": {
"description": "bytes",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Account": {
"type": "object",
"required": [
"id",
"secret",
"display_name",
"settings"
],
"properties": {
"id": {
"type": "integer",
"readOnly": true
},
"secret": {
"type": "string",
"writeOnly": true,
"minLength": 8
},
"display_name": {
"type": [
"string",
"null"
]
},
"state": {
"$ref": "#/components/schemas/AccountState"
},
"settings": {
"$ref": "#/components/schemas/FlexibleSettings"
}
}
},
"AccountState": {
"type": "string",
"enum": [
"active",
"disabled"
],
"x-enumNames": [
"active",
"disabled"
]
},
"FlexibleSettings": {
"type": "object",
"required": [
"theme"
],
"properties": {
"theme": {
"type": "string"
}
},
"additionalProperties": {
"type": "integer"
}
},
"UnionEnvelope": {
"type": "object",
"required": [
"value",
"criteria"
],
"properties": {
"value": {
"$ref": "#/components/schemas/StringOrInteger"
},
"criteria": {
"$ref": "#/components/schemas/SearchCriteria"
}
}
},
"StringOrInteger": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"SearchCriteria": {
"anyOf": [
{
"title": "ByName",
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
}
}
},
{
"title": "ById",
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "integer"
}
}
}
]
}
}
}
}