
George St Maurice (Progress Software) asked a question.
Generate a JavaScript Vocabulary: Schema extend with allOf
- {
- "$schema": "http://json-schema.org/draft-07/schema#",
- "definitions":
- {
- "address":
- {
- "type": "object",
- "properties": {
- "Zip": {
- "type": "string"
- },
- "State": {
- "type": "string"
- },
- "Address1": {
- "type": "string"
- },
- "Address2": {
- "type": "string"
- },
- "City": {
- "type": "string"
- }
- }
- }
- },
- "type": "object",
- "properties": {
- "BillingAddress": {
- "description": "Address to where a Customer's invoice must go",
- "$ref": "#/definitions/address"
- },
- "CompanyName": {
- "type": "string"
- },
- "Phone": {
- "type": "string"
- },
- "ShippingAddress": {
- "description": "Address to where a Customer's product must go",
- "allOf": [
- { "$ref": "#/definitions/address" },
- { "properties":
- { "type":
- {
- "title": "Address Type Enumeration",
- "description": "Specifies if the address is a Business or Residence",
- "enum": [ "residential", "business" ]
- }
- },
- }
- ]
- },
- "Notes": {
- "type": "string"
- },
- "Contact": {
- "type": "string"
- }
- }
- }