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:
72
backend/schema/components/redirection-host-object.json
Normal file
72
backend/schema/components/redirection-host-object.json
Normal file
@ -0,0 +1,72 @@
|
||||
{
|
||||
"type": "object",
|
||||
"description": "Redirection Host object",
|
||||
"required": ["id", "created_on", "modified_on", "owner_user_id", "domain_names", "forward_http_code", "forward_scheme", "forward_domain_name", "preserve_path", "certificate_id", "ssl_forced", "hsts_enabled", "hsts_subdomains", "http2_support", "block_exploits", "advanced_config", "enabled", "meta"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"id": {
|
||||
"$ref": "../common.json#/definitions/id"
|
||||
},
|
||||
"created_on": {
|
||||
"$ref": "../common.json#/definitions/created_on"
|
||||
},
|
||||
"modified_on": {
|
||||
"$ref": "../common.json#/definitions/modified_on"
|
||||
},
|
||||
"owner_user_id": {
|
||||
"$ref": "../common.json#/definitions/user_id"
|
||||
},
|
||||
"domain_names": {
|
||||
"$ref": "../common.json#/definitions/domain_names"
|
||||
},
|
||||
"forward_http_code": {
|
||||
"description": "Redirect HTTP Status Code",
|
||||
"example": 302,
|
||||
"type": "integer",
|
||||
"minimum": 300,
|
||||
"maximum": 308
|
||||
},
|
||||
"forward_scheme": {
|
||||
"type": "string",
|
||||
"enum": ["http", "https"]
|
||||
},
|
||||
"forward_domain_name": {
|
||||
"description": "Domain Name",
|
||||
"example": "jc21.com",
|
||||
"type": "string",
|
||||
"pattern": "^(?:[^.*]+\\.?)+[^.]$"
|
||||
},
|
||||
"preserve_path": {
|
||||
"description": "Should the path be preserved",
|
||||
"example": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"certificate_id": {
|
||||
"$ref": "../common.json#/definitions/certificate_id"
|
||||
},
|
||||
"ssl_forced": {
|
||||
"$ref": "../common.json#/definitions/ssl_forced"
|
||||
},
|
||||
"hsts_enabled": {
|
||||
"$ref": "../common.json#/definitions/hsts_enabled"
|
||||
},
|
||||
"hsts_subdomains": {
|
||||
"$ref": "../common.json#/definitions/hsts_subdomains"
|
||||
},
|
||||
"http2_support": {
|
||||
"$ref": "../common.json#/definitions/http2_support"
|
||||
},
|
||||
"block_exploits": {
|
||||
"$ref": "../common.json#/definitions/block_exploits"
|
||||
},
|
||||
"advanced_config": {
|
||||
"type": "string"
|
||||
},
|
||||
"enabled": {
|
||||
"$ref": "../common.json#/definitions/enabled"
|
||||
},
|
||||
"meta": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user