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:
61
backend/schema/components/user-object.json
Normal file
61
backend/schema/components/user-object.json
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"type": "object",
|
||||
"description": "User object",
|
||||
"required": ["id", "created_on", "modified_on", "is_disabled", "email", "name", "nickname", "avatar", "roles"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer",
|
||||
"description": "User ID",
|
||||
"minimum": 1,
|
||||
"example": 1
|
||||
},
|
||||
"created_on": {
|
||||
"type": "string",
|
||||
"description": "Created Date",
|
||||
"example": "2020-01-30T09:36:08.000Z"
|
||||
},
|
||||
"modified_on": {
|
||||
"type": "string",
|
||||
"description": "Modified Date",
|
||||
"example": "2020-01-30T09:41:04.000Z"
|
||||
},
|
||||
"is_disabled": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 1,
|
||||
"description": "Is user Disabled (0 = false, 1 = true)",
|
||||
"example": 0
|
||||
},
|
||||
"email": {
|
||||
"type": "string",
|
||||
"description": "Email",
|
||||
"minLength": 3,
|
||||
"example": "jc@jc21.com"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "Name",
|
||||
"minLength": 1,
|
||||
"example": "Jamie Curnow"
|
||||
},
|
||||
"nickname": {
|
||||
"type": "string",
|
||||
"description": "Nickname",
|
||||
"example": "James"
|
||||
},
|
||||
"avatar": {
|
||||
"type": "string",
|
||||
"description": "Gravatar URL based on email, without scheme",
|
||||
"example": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm"
|
||||
},
|
||||
"roles": {
|
||||
"description": "Roles applied",
|
||||
"example": ["admin"],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user