mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-06-18 10:06:26 +00:00
Refactor API Schema and validation
- /schema now returns full openapi/swagger schema - That schema is used to validate incoming requests - And used as a contract in future integration tests - Moved route files up one level - Fixed incorrect 404 reponses when getting objects - Fixed saving new objects and passing jsonschemavalidation
This commit is contained in:
87
backend/schema/paths/nginx/streams/post.json
Normal file
87
backend/schema/paths/nginx/streams/post.json
Normal file
@ -0,0 +1,87 @@
|
||||
{
|
||||
"operationId": "createStream",
|
||||
"summary": "Create a Stream",
|
||||
"tags": ["Streams"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["streams"]
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Stream Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["incoming_port", "forwarding_host", "forwarding_port"],
|
||||
"properties": {
|
||||
"incoming_port": {
|
||||
"$ref": "../../../components/stream-object.json#/properties/incoming_port"
|
||||
},
|
||||
"forwarding_host": {
|
||||
"$ref": "../../../components/stream-object.json#/properties/forwarding_host"
|
||||
},
|
||||
"forwarding_port": {
|
||||
"$ref": "../../../components/stream-object.json#/properties/forwarding_port"
|
||||
},
|
||||
"tcp_forwarding": {
|
||||
"$ref": "../../../components/stream-object.json#/properties/tcp_forwarding"
|
||||
},
|
||||
"udp_forwarding": {
|
||||
"$ref": "../../../components/stream-object.json#/properties/udp_forwarding"
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "../../../components/stream-object.json#/properties/meta"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "201 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T02:33:45.000Z",
|
||||
"modified_on": "2024-10-09T02:33:45.000Z",
|
||||
"owner_user_id": 1,
|
||||
"incoming_port": 9090,
|
||||
"forwarding_host": "router.internal",
|
||||
"forwarding_port": 80,
|
||||
"tcp_forwarding": 0,
|
||||
"udp_forwarding": 0,
|
||||
"meta": {
|
||||
"nginx_online": true,
|
||||
"nginx_err": null
|
||||
},
|
||||
"enabled": 1,
|
||||
"owner": {
|
||||
"id": 1,
|
||||
"created_on": "2024-10-09T02:33:16.000Z",
|
||||
"modified_on": "2024-10-09T02:33:16.000Z",
|
||||
"is_deleted": 0,
|
||||
"is_disabled": 0,
|
||||
"email": "admin@example.com",
|
||||
"name": "Administrator",
|
||||
"nickname": "Admin",
|
||||
"avatar": "",
|
||||
"roles": ["admin"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/stream-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user