George St Maurice (Progress Software) asked a question.

Generate a JavaScript Vocabulary: Schema extend with allOf
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "definitions":
  4. {
  5. "address":
  6. {
  7. "type": "object",
  8. "properties": {
  9. "Zip": {
  10. "type": "string"
  11. },
  12. "State": {
  13. "type": "string"
  14. },
  15. "Address1": {
  16. "type": "string"
  17. },
  18. "Address2": {
  19. "type": "string"
  20. },
  21. "City": {
  22. "type": "string"
  23. }
  24. }
  25. }
  26. },
  27. "type": "object",
  28. "properties": {
  29. "BillingAddress": {
  30. "description": "Address to where a Customer's invoice must go",
  31. "$ref": "#/definitions/address"
  32. },
  33. "CompanyName": {
  34. "type": "string"
  35. },
  36. "Phone": {
  37. "type": "string"
  38. },
  39. "ShippingAddress": {
  40. "description": "Address to where a Customer's product must go",
  41. "allOf": [
  42. { "$ref": "#/definitions/address" },
  43. { "properties":
  44. { "type":
  45. {
  46. "title": "Address Type Enumeration",
  47. "description": "Specifies if the address is a Business or Residence",
  48. "enum": [ "residential", "business" ]
  49. }
  50. },
  51. }
  52. ]
  53. },
  54. "Notes": {
  55. "type": "string"
  56. },
  57. "Contact": {
  58. "type": "string"
  59. }
  60. }
  61. }