schemaschema.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. Copyright 2018 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package schema
  14. // SchemaSchemaYAML is a schema against which you can validate other schemas.
  15. // It will validate itself. It can be unmarshalled into a Schema type.
  16. var SchemaSchemaYAML = `types:
  17. - name: schema
  18. struct:
  19. fields:
  20. - name: types
  21. type:
  22. list:
  23. elementRelationship: associative
  24. elementType:
  25. namedType: typeDef
  26. keys:
  27. - name
  28. - name: typeDef
  29. struct:
  30. fields:
  31. - name: name
  32. type:
  33. scalar: string
  34. - name: scalar
  35. type:
  36. scalar: string
  37. - name: struct
  38. type:
  39. namedType: struct
  40. - name: list
  41. type:
  42. namedType: list
  43. - name: map
  44. type:
  45. namedType: map
  46. - name: untyped
  47. type:
  48. namedType: untyped
  49. - name: typeRef
  50. struct:
  51. fields:
  52. - name: namedType
  53. type:
  54. scalar: string
  55. - name: scalar
  56. type:
  57. scalar: string
  58. - name: struct
  59. type:
  60. namedType: struct
  61. - name: list
  62. type:
  63. namedType: list
  64. - name: map
  65. type:
  66. namedType: map
  67. - name: untyped
  68. type:
  69. namedType: untyped
  70. - name: scalar
  71. scalar: string
  72. - name: struct
  73. struct:
  74. fields:
  75. - name: fields
  76. type:
  77. list:
  78. elementType:
  79. namedType: structField
  80. elementRelationship: associative
  81. keys: [ "name" ]
  82. - name: elementRelationship
  83. type:
  84. scalar: string
  85. - name: structField
  86. struct:
  87. fields:
  88. - name: name
  89. type:
  90. scalar: string
  91. - name: type
  92. type:
  93. namedType: typeRef
  94. - name: list
  95. struct:
  96. fields:
  97. - name: elementType
  98. type:
  99. namedType: typeRef
  100. - name: elementRelationship
  101. type:
  102. scalar: string
  103. - name: keys
  104. type:
  105. list:
  106. elementType:
  107. scalar: string
  108. - name: map
  109. struct:
  110. fields:
  111. - name: elementType
  112. type:
  113. namedType: typeRef
  114. - name: elementRelationship
  115. type:
  116. scalar: string
  117. - name: untyped
  118. struct:
  119. fields:
  120. - name: elementRelationship
  121. type:
  122. scalar: string
  123. `