Skip to content

Commit

Permalink
define $schema, define schema at root level instead of nested
Browse files Browse the repository at this point in the history
  • Loading branch information
creme332 committed May 18, 2024
1 parent b14f26f commit a0de758
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 49 deletions.
41 changes: 20 additions & 21 deletions resources/schema/Administrator.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
{
"administrator": {
"allOf": [
{
"$ref": "User.json#/definitions/user"
},
{
"type": "object",
"properties": {
"job_title": {
"type": "string",
"minLength": 4
},
"is_super_admin": {
"type": "boolean"
}
"$schema": "http://json-schema.org/draft-07/schema#",
"allOf": [
{
"$ref": "User.json#/definitions/user"
},
{
"type": "object",
"properties": {
"job_title": {
"type": "string",
"minLength": 4
},
"required": [
"job_title"
]
}
]
}
"is_super_admin": {
"type": "boolean"
}
},
"required": [
"job_title"
]
}
]
}
55 changes: 27 additions & 28 deletions resources/schema/Client.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
{
"client": {
"allOf": [
{
"$ref": "User.json#/definitions/user"
},
{
"type": "object",
"properties": {
"street": {
"type": "string",
"minLength": 4
},
"city": {
"type": "string",
"minLength": 3
},
"district_id": {
"type": "integer",
"minimum": 1
}
"$schema": "http://json-schema.org/draft-07/schema#",
"allOf": [
{
"$ref": "User.json#/definitions/user"
},
{
"type": "object",
"properties": {
"street": {
"type": "string",
"minLength": 4
},
"city": {
"type": "string",
"minLength": 3
},
"required": [
"street",
"city",
"district_id"
]
}
]
}
"district_id": {
"type": "integer",
"minimum": 1
}
},
"required": [
"street",
"city",
"district_id"
]
}
]
}

0 comments on commit a0de758

Please sign in to comment.