schemaschema.go 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. map:
  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. map:
  30. fields:
  31. - name: name
  32. type:
  33. scalar: string
  34. - name: scalar
  35. type:
  36. scalar: string
  37. - name: map
  38. type:
  39. namedType: map
  40. - name: list
  41. type:
  42. namedType: list
  43. - name: untyped
  44. type:
  45. namedType: untyped
  46. - name: typeRef
  47. map:
  48. fields:
  49. - name: namedType
  50. type:
  51. scalar: string
  52. - name: scalar
  53. type:
  54. scalar: string
  55. - name: map
  56. type:
  57. namedType: map
  58. - name: list
  59. type:
  60. namedType: list
  61. - name: untyped
  62. type:
  63. namedType: untyped
  64. - name: elementRelationship
  65. type:
  66. scalar: string
  67. - name: scalar
  68. scalar: string
  69. - name: map
  70. map:
  71. fields:
  72. - name: fields
  73. type:
  74. list:
  75. elementType:
  76. namedType: structField
  77. elementRelationship: associative
  78. keys: [ "name" ]
  79. - name: unions
  80. type:
  81. list:
  82. elementType:
  83. namedType: union
  84. elementRelationship: atomic
  85. - name: elementType
  86. type:
  87. namedType: typeRef
  88. - name: elementRelationship
  89. type:
  90. scalar: string
  91. - name: unionField
  92. map:
  93. fields:
  94. - name: fieldName
  95. type:
  96. scalar: string
  97. - name: discriminatorValue
  98. type:
  99. scalar: string
  100. - name: union
  101. map:
  102. fields:
  103. - name: discriminator
  104. type:
  105. scalar: string
  106. - name: deduceInvalidDiscriminator
  107. type:
  108. scalar: bool
  109. - name: fields
  110. type:
  111. list:
  112. elementRelationship: associative
  113. elementType:
  114. namedType: unionField
  115. keys:
  116. - fieldName
  117. - name: structField
  118. map:
  119. fields:
  120. - name: name
  121. type:
  122. scalar: string
  123. - name: type
  124. type:
  125. namedType: typeRef
  126. - name: default
  127. type:
  128. namedType: __untyped_atomic_
  129. - name: list
  130. map:
  131. fields:
  132. - name: elementType
  133. type:
  134. namedType: typeRef
  135. - name: elementRelationship
  136. type:
  137. scalar: string
  138. - name: keys
  139. type:
  140. list:
  141. elementType:
  142. scalar: string
  143. - name: untyped
  144. map:
  145. fields:
  146. - name: elementRelationship
  147. type:
  148. scalar: string
  149. - name: __untyped_atomic_
  150. scalar: untyped
  151. list:
  152. elementType:
  153. namedType: __untyped_atomic_
  154. elementRelationship: atomic
  155. map:
  156. elementType:
  157. namedType: __untyped_atomic_
  158. elementRelationship: atomic
  159. `