mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-09-17 20:30:34 +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:
77
backend/schema/paths/nginx/certificates/post.json
Normal file
77
backend/schema/paths/nginx/certificates/post.json
Normal file
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"operationId": "createCertificate",
|
||||
"summary": "Create a Certificate",
|
||||
"tags": ["Certificates"],
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": ["certificates"]
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"description": "Certificate Payload",
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["provider"],
|
||||
"properties": {
|
||||
"provider": {
|
||||
"$ref": "../../../components/certificate-object.json#/properties/provider"
|
||||
},
|
||||
"nice_name": {
|
||||
"$ref": "../../../components/certificate-object.json#/properties/nice_name"
|
||||
},
|
||||
"domain_names": {
|
||||
"$ref": "../../../components/certificate-object.json#/properties/domain_names"
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "../../../components/certificate-object.json#/properties/meta"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "201 response",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"default": {
|
||||
"value": {
|
||||
"expires_on": "2025-01-07 04:30:17",
|
||||
"modified_on": "2024-10-09 05:28:51",
|
||||
"id": 5,
|
||||
"created_on": "2024-10-09 05:28:35",
|
||||
"owner_user_id": 1,
|
||||
"is_deleted": 0,
|
||||
"provider": "letsencrypt",
|
||||
"nice_name": "test.example.com",
|
||||
"domain_names": ["test.example.com"],
|
||||
"meta": {
|
||||
"letsencrypt_email": "jc@jc21.com",
|
||||
"letsencrypt_agree": true,
|
||||
"dns_challenge": false,
|
||||
"letsencrypt_certificate": {
|
||||
"cn": "test.example.com",
|
||||
"issuer": "C = US, O = Let's Encrypt, CN = E5",
|
||||
"dates": {
|
||||
"from": 1728448218,
|
||||
"to": 1736224217
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "../../../components/certificate-object.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user