schemaschema.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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: scalar
  65. scalar: string
  66. - name: map
  67. map:
  68. fields:
  69. - name: fields
  70. type:
  71. list:
  72. elementType:
  73. namedType: structField
  74. elementRelationship: associative
  75. keys: [ "name" ]
  76. - name: unions
  77. type:
  78. list:
  79. elementType:
  80. namedType: union
  81. elementRelationship: atomic
  82. - name: elementType
  83. type:
  84. namedType: typeRef
  85. - name: elementRelationship
  86. type:
  87. scalar: string
  88. - name: unionField
  89. map:
  90. fields:
  91. - name: fieldName
  92. type:
  93. scalar: string
  94. - name: discriminatorValue
  95. type:
  96. scalar: string
  97. - name: union
  98. map:
  99. fields:
  100. - name: discriminator
  101. type:
  102. scalar: string
  103. - name: deduceInvalidDiscriminator
  104. type:
  105. scalar: bool
  106. - name: fields
  107. type:
  108. list:
  109. elementRelationship: associative
  110. elementType:
  111. namedType: unionField
  112. keys:
  113. - fieldName
  114. - name: structField
  115. map:
  116. fields:
  117. - name: name
  118. type:
  119. scalar: string
  120. - name: type
  121. type:
  122. namedType: typeRef
  123. - name: list
  124. map:
  125. fields:
  126. - name: elementType
  127. type:
  128. namedType: typeRef
  129. - name: elementRelationship
  130. type:
  131. scalar: string
  132. - name: keys
  133. type:
  134. list:
  135. elementType:
  136. scalar: string
  137. - name: untyped
  138. map:
  139. fields:
  140. - name: elementRelationship
  141. type:
  142. scalar: string
  143. `