-
Notifications
You must be signed in to change notification settings - Fork 901
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JSON referenced schema support (#1514)
* JSON referenced schema support * Changes * PR Feedback * PR Feedback * PR Feedback * PR Feedback * Fix wrong documentation * PR Feedback * Update unit tests * PR Feedback * Use ref.name as the id * Remove _id_of function
- Loading branch information
Showing
7 changed files
with
441 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://example.com/customer.schema.json", | ||
"title": "Customer", | ||
"description": "Customer data", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"description": "Customer name", | ||
"type": "string" | ||
}, | ||
"id": { | ||
"description": "Customer id", | ||
"type": "integer" | ||
}, | ||
"email": { | ||
"description": "Customer email", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ "name", "id"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://example.com/referencedproduct.schema.json", | ||
"title": "Order", | ||
"description": "Order", | ||
"type": "object", | ||
"properties": { | ||
"order_details": { | ||
"description": "Order Details", | ||
"$ref": "http://example.com/order_details.schema.json" | ||
}, | ||
"order_date": { | ||
"description": "Order Date", | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"product": { | ||
"description": "Product", | ||
"$ref": "http://example.com/product.schema.json" | ||
} | ||
}, | ||
"required": [ | ||
"order_details", "product"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://example.com/order_details.schema.json", | ||
"title": "Order Details", | ||
"description": "Order Details", | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"description": "Order Id", | ||
"type": "integer" | ||
}, | ||
"customer": { | ||
"description": "Customer", | ||
"$ref": "http://example.com/customer.schema.json" | ||
}, | ||
"payment_id": { | ||
"description": "Payment Id", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ "id", "customer"] | ||
} |
Oops, something went wrong.