Add AID export: OpenAPI from api-format and app generator bundle
Nest: POST /aid/export/openapi, POST /aid/export/app. Tools: api-format-to-openapi CLI. Generator: --print-bundle-json. Optional env: AID_EXPORT_API_KEY, AID_GENERATOR_ALLOW_APPLY.
This commit is contained in:
36
tools/api-format-to-openapi/examples/api-format.example.json
Normal file
36
tools/api-format-to-openapi/examples/api-format.example.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"apiFormatVersion": "1",
|
||||
"info": {
|
||||
"title": "TOiR Demo API",
|
||||
"version": "1.0.0",
|
||||
"description": "Абстрактный пример доменного описания API (не OpenAPI)."
|
||||
},
|
||||
"server": {
|
||||
"basePath": "/api"
|
||||
},
|
||||
"security": {
|
||||
"type": "bearer",
|
||||
"scheme": "JWT"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"name": "Equipment",
|
||||
"pathSegment": "equipment",
|
||||
"idParam": "id",
|
||||
"idType": "uuid",
|
||||
"fields": [
|
||||
{ "name": "id", "type": "uuid", "readOnly": true },
|
||||
{ "name": "inventoryNumber", "type": "string", "required": true },
|
||||
{ "name": "name", "type": "string", "required": true },
|
||||
{ "name": "status", "type": "enum", "enumValues": ["Active", "Repair", "Decommissioned"] },
|
||||
{ "name": "location", "type": "string" }
|
||||
],
|
||||
"operations": ["list", "get", "create", "update", "delete"],
|
||||
"listQuery": {
|
||||
"pagination": ["_start", "_end"],
|
||||
"sort": ["_sort", "_order"],
|
||||
"filters": ["q", "status"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user