@adobe/jsonschema2md 6.1.3 → 7.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +3 -17
  2. package/{.releaserc.js → .releaserc.cjs} +0 -0
  3. package/CHANGELOG.md +41 -0
  4. package/README.md +1 -1
  5. package/cli.js +1 -1
  6. package/lib/formatInfo.js +17 -19
  7. package/lib/formattingTools.js +6 -8
  8. package/lib/index.js +176 -81
  9. package/lib/keywords.js +2 -4
  10. package/lib/locales/update.js +2 -2
  11. package/lib/markdownBuilder.js +62 -44
  12. package/lib/readmeBuilder.js +15 -15
  13. package/lib/schemaProxy.js +32 -26
  14. package/lib/symbols.js +14 -2
  15. package/lib/traverseSchema.js +5 -5
  16. package/lib/writeMarkdown.js +87 -41
  17. package/lib/writeSchema.js +46 -21
  18. package/package.json +41 -30
  19. package/types/api.d.ts +72 -0
  20. package/types/formatInfo.d.ts +19 -0
  21. package/types/formattingTools.d.ts +2 -0
  22. package/types/index.d.ts +75 -0
  23. package/types/keywords.d.ts +2 -0
  24. package/types/markdownBuilder.d.ts +8 -0
  25. package/types/readmeBuilder.d.ts +5 -0
  26. package/types/schemaProxy.d.ts +1 -0
  27. package/types/symbols.d.ts +11 -0
  28. package/types/traverseSchema.d.ts +6 -0
  29. package/types/writeMarkdown.d.ts +56 -0
  30. package/types/writeSchema.d.ts +19 -0
  31. package/.circleci/config.yml +0 -83
  32. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -23
  33. package/.github/workflows/semantic-release.yaml +0 -55
  34. package/.github/workflows/semver-check.yaml +0 -16
  35. package/.renovaterc.json +0 -3
  36. package/.tidelift.yml +0 -32
  37. package/crowdin.yml +0 -4
  38. package/examples/abstract.md +0 -3
  39. package/examples/docs/README.md +0 -121
  40. package/examples/docs/abstract-definitions-first-properties-foo.md +0 -15
  41. package/examples/docs/abstract-definitions-first-properties-nonfoo.md +0 -23
  42. package/examples/docs/abstract-definitions-first.md +0 -66
  43. package/examples/docs/abstract-definitions-second-properties-bar.md +0 -15
  44. package/examples/docs/abstract-definitions-second.md +0 -39
  45. package/examples/docs/abstract-definitions.md +0 -15
  46. package/examples/docs/abstract.md +0 -104
  47. package/examples/docs/arrays-properties-boollist-items.md +0 -15
  48. package/examples/docs/arrays-properties-boollist.md +0 -19
  49. package/examples/docs/arrays-properties-coordinatelist-items-items.md +0 -21
  50. package/examples/docs/arrays-properties-coordinatelist-items.md +0 -21
  51. package/examples/docs/arrays-properties-coordinatelist.md +0 -19
  52. package/examples/docs/arrays-properties-intlist-items.md +0 -15
  53. package/examples/docs/arrays-properties-intlist.md +0 -21
  54. package/examples/docs/arrays-properties-jointypelist-items-oneof-0-properties-foo.md +0 -21
  55. package/examples/docs/arrays-properties-jointypelist-items-oneof-0.md +0 -45
  56. package/examples/docs/arrays-properties-jointypelist-items-oneof-1-properties-bar.md +0 -21
  57. package/examples/docs/arrays-properties-jointypelist-items-oneof-1.md +0 -45
  58. package/examples/docs/arrays-properties-jointypelist-items.md +0 -21
  59. package/examples/docs/arrays-properties-jointypelist.md +0 -15
  60. package/examples/docs/arrays-properties-list-items.md +0 -15
  61. package/examples/docs/arrays-properties-list.md +0 -15
  62. package/examples/docs/arrays-properties-listlist-items.md +0 -15
  63. package/examples/docs/arrays-properties-listlist.md +0 -15
  64. package/examples/docs/arrays-properties-numlist-items.md +0 -19
  65. package/examples/docs/arrays-properties-numlist.md +0 -19
  66. package/examples/docs/arrays-properties-objectlist-items-properties-a.md +0 -15
  67. package/examples/docs/arrays-properties-objectlist-items-properties-b.md +0 -15
  68. package/examples/docs/arrays-properties-objectlist-items.md +0 -58
  69. package/examples/docs/arrays-properties-objectlist.md +0 -15
  70. package/examples/docs/arrays-properties-stringlistlist-items-items.md +0 -15
  71. package/examples/docs/arrays-properties-stringlistlist-items.md +0 -15
  72. package/examples/docs/arrays-properties-stringlistlist.md +0 -15
  73. package/examples/docs/arrays-properties-tuple-items-negative-integer.md +0 -19
  74. package/examples/docs/arrays-properties-tuple-items-positive-integer.md +0 -19
  75. package/examples/docs/arrays-properties-tuple-zero.md +0 -23
  76. package/examples/docs/arrays-properties-tuple.md +0 -21
  77. package/examples/docs/arrays.md +0 -240
  78. package/examples/docs/complex-additionalproperties.md +0 -15
  79. package/examples/docs/complex-patternproperties-int.md +0 -15
  80. package/examples/docs/complex-patternproperties-str.md +0 -15
  81. package/examples/docs/complex-patternproperties.md +0 -15
  82. package/examples/docs/complex-properties-and-allof-0.md +0 -19
  83. package/examples/docs/complex-properties-and-allof-1.md +0 -19
  84. package/examples/docs/complex-properties-and.md +0 -21
  85. package/examples/docs/complex-properties-or-anyof-0.md +0 -15
  86. package/examples/docs/complex-properties-or-anyof-1.md +0 -19
  87. package/examples/docs/complex-properties-or.md +0 -21
  88. package/examples/docs/complex-properties-reflocalfiledef.md +0 -39
  89. package/examples/docs/complex-properties-refnestedobj-properties-refobj.md +0 -39
  90. package/examples/docs/complex-properties-refnestedobj.md +0 -39
  91. package/examples/docs/complex-properties-refobj.md +0 -39
  92. package/examples/docs/complex-properties-xor-oneof-0.md +0 -19
  93. package/examples/docs/complex-properties-xor-oneof-1.md +0 -19
  94. package/examples/docs/complex-properties-xor.md +0 -21
  95. package/examples/docs/complex.md +0 -285
  96. package/examples/docs/constants-properties-hello.md +0 -23
  97. package/examples/docs/constants.md +0 -47
  98. package/examples/docs/custom-allof-0.md +0 -15
  99. package/examples/docs/custom-allof-1.md +0 -39
  100. package/examples/docs/custom-allof-2.md +0 -39
  101. package/examples/docs/custom-definitions-first-properties-foo.md +0 -15
  102. package/examples/docs/custom-definitions-first-properties.md +0 -15
  103. package/examples/docs/custom-definitions-first.md +0 -39
  104. package/examples/docs/custom-definitions-second-properties-bar.md +0 -15
  105. package/examples/docs/custom-definitions-second-properties.md +0 -15
  106. package/examples/docs/custom-definitions-second.md +0 -39
  107. package/examples/docs/custom-definitions.md +0 -15
  108. package/examples/docs/custom.md +0 -85
  109. package/examples/docs/deepextending-allof-0.md +0 -49
  110. package/examples/docs/deepextending-allof-1.md +0 -89
  111. package/examples/docs/deepextending-allof-3.md +0 -39
  112. package/examples/docs/deepextending-definitions-fourth-properties-hey.md +0 -15
  113. package/examples/docs/deepextending-definitions-fourth-properties.md +0 -15
  114. package/examples/docs/deepextending-definitions-fourth.md +0 -39
  115. package/examples/docs/deepextending-definitions.md +0 -15
  116. package/examples/docs/deepextending.md +0 -57
  117. package/examples/docs/definitions-definitions-myid-properties-id-1.md +0 -19
  118. package/examples/docs/definitions-definitions-myid-properties-id.md +0 -19
  119. package/examples/docs/definitions-definitions-myid-properties-metaid.md +0 -19
  120. package/examples/docs/definitions-definitions-myid-properties.md +0 -15
  121. package/examples/docs/definitions-definitions-myid.md +0 -89
  122. package/examples/docs/definitions-definitions.md +0 -15
  123. package/examples/docs/definitions.md +0 -117
  124. package/examples/docs/enums-properties-enumerated-nested-properties-test.md +0 -25
  125. package/examples/docs/enums-properties-enumerated-nested.md +0 -49
  126. package/examples/docs/enums-properties-hello.md +0 -24
  127. package/examples/docs/enums.md +0 -67
  128. package/examples/docs/example-properties-bar.md +0 -25
  129. package/examples/docs/example-properties-foo.md +0 -21
  130. package/examples/docs/example.md +0 -83
  131. package/examples/docs/examples-properties-bar.md +0 -25
  132. package/examples/docs/examples-properties-foo.md +0 -21
  133. package/examples/docs/examples.md +0 -90
  134. package/examples/docs/extending-definitions-third-properties-baaaz.md +0 -21
  135. package/examples/docs/extending-definitions-third.md +0 -45
  136. package/examples/docs/extending-definitions.md +0 -15
  137. package/examples/docs/extending.md +0 -61
  138. package/examples/docs/extensible-definitions-first-properties-foo.md +0 -21
  139. package/examples/docs/extensible-definitions-first-properties.md +0 -15
  140. package/examples/docs/extensible-definitions-first.md +0 -45
  141. package/examples/docs/extensible-definitions-second-properties-bar.md +0 -25
  142. package/examples/docs/extensible-definitions-second-properties.md +0 -15
  143. package/examples/docs/extensible-definitions-second.md +0 -49
  144. package/examples/docs/extensible-definitions.md +0 -15
  145. package/examples/docs/extensible.md +0 -93
  146. package/examples/docs/identifiable-properties-id.md +0 -19
  147. package/examples/docs/identifiable.md +0 -43
  148. package/examples/docs/join-oneof-0-not-oneof-0-properties-foo.md +0 -21
  149. package/examples/docs/join-oneof-0-not-oneof-0.md +0 -45
  150. package/examples/docs/join-oneof-0-not-oneof-1-properties-bar.md +0 -21
  151. package/examples/docs/join-oneof-0-not-oneof-1.md +0 -45
  152. package/examples/docs/join-oneof-0-not.md +0 -21
  153. package/examples/docs/join-oneof-0.md +0 -23
  154. package/examples/docs/join-oneof-1-allof-0-properties-foo.md +0 -21
  155. package/examples/docs/join-oneof-1-allof-0.md +0 -45
  156. package/examples/docs/join-oneof-1.md +0 -19
  157. package/examples/docs/join-oneof-2-anyof-0-properties-bar.md +0 -21
  158. package/examples/docs/join-oneof-2-anyof-0.md +0 -45
  159. package/examples/docs/join-oneof-2.md +0 -19
  160. package/examples/docs/join.md +0 -33
  161. package/examples/docs/nestedobj-properties-settings-properties-collaborators-patternproperties-.md +0 -15
  162. package/examples/docs/nestedobj-properties-settings-properties-collaborators-patternproperties.md +0 -15
  163. package/examples/docs/nestedobj-properties-settings-properties-collaborators-properties-id.md +0 -15
  164. package/examples/docs/nestedobj-properties-settings-properties-collaborators.md +0 -58
  165. package/examples/docs/nestedobj-properties-settings.md +0 -39
  166. package/examples/docs/nestedobj.md +0 -39
  167. package/examples/docs/pattern-patternproperties-0-9.md +0 -21
  168. package/examples/docs/pattern-patternproperties.md +0 -15
  169. package/examples/docs/pattern.md +0 -45
  170. package/examples/docs/simple-properties-id.md +0 -19
  171. package/examples/docs/simple.md +0 -43
  172. package/examples/docs/simpletypes-properties-integer_threes.md +0 -23
  173. package/examples/docs/simpletypes-properties-interger_constrained.md +0 -19
  174. package/examples/docs/simpletypes-properties-interger_unconstrained.md +0 -15
  175. package/examples/docs/simpletypes-properties-number_constrained.md +0 -19
  176. package/examples/docs/simpletypes-properties-number_unconstrained.md +0 -15
  177. package/examples/docs/simpletypes-properties-string_date.md +0 -19
  178. package/examples/docs/simpletypes-properties-string_email.md +0 -19
  179. package/examples/docs/simpletypes-properties-string_hostname.md +0 -19
  180. package/examples/docs/simpletypes-properties-string_ipv4.md +0 -19
  181. package/examples/docs/simpletypes-properties-string_ipv6.md +0 -19
  182. package/examples/docs/simpletypes-properties-string_length.md +0 -31
  183. package/examples/docs/simpletypes-properties-string_pattern-metaenum.md +0 -15
  184. package/examples/docs/simpletypes-properties-string_pattern.md +0 -39
  185. package/examples/docs/simpletypes-properties-string_pattern_noexample.md +0 -25
  186. package/examples/docs/simpletypes-properties-string_pattern_singleexample.md +0 -31
  187. package/examples/docs/simpletypes-properties-string_unconstrained.md +0 -21
  188. package/examples/docs/simpletypes-properties-string_uri.md +0 -19
  189. package/examples/docs/simpletypes-properties-yesno.md +0 -15
  190. package/examples/docs/simpletypes.md +0 -455
  191. package/examples/docs/stabilizing-properties-id.md +0 -19
  192. package/examples/docs/stabilizing.md +0 -43
  193. package/examples/docs/subdir-allof-0.md +0 -43
  194. package/examples/docs/subdir-definitions-content-properties-id.md +0 -19
  195. package/examples/docs/subdir-definitions-content-properties.md +0 -15
  196. package/examples/docs/subdir-definitions-content.md +0 -43
  197. package/examples/docs/subdir-definitions.md +0 -15
  198. package/examples/docs/subdir.md +0 -55
  199. package/examples/docs/typearrays-properties-null.md +0 -15
  200. package/examples/docs/typearrays-properties-string-or-null.md +0 -15
  201. package/examples/docs/typearrays-properties-string-or-number-null.md +0 -15
  202. package/examples/docs/typearrays-properties-string-or-number.md +0 -15
  203. package/examples/docs/typearrays.md +0 -96
  204. package/examples/docsWithoutHeader/arrays.schema.md +0 -254
  205. package/examples/generated-schemas/abstract.schema.json +0 -1
  206. package/examples/generated-schemas/arrays.schema.json +0 -1
  207. package/examples/generated-schemas/complex.schema.json +0 -1
  208. package/examples/generated-schemas/constants.schema.json +0 -1
  209. package/examples/generated-schemas/custom.schema.json +0 -1
  210. package/examples/generated-schemas/deepextending.schema.json +0 -1
  211. package/examples/generated-schemas/definitions.schema.json +0 -1
  212. package/examples/generated-schemas/enums.schema.json +0 -1
  213. package/examples/generated-schemas/example.schema.json +0 -1
  214. package/examples/generated-schemas/examples.schema.json +0 -1
  215. package/examples/generated-schemas/extending.schema.json +0 -1
  216. package/examples/generated-schemas/extensible.schema.json +0 -1
  217. package/examples/generated-schemas/identifiable.schema.json +0 -1
  218. package/examples/generated-schemas/join.schema.json +0 -1
  219. package/examples/generated-schemas/nestedobj.schema.json +0 -1
  220. package/examples/generated-schemas/pattern.schema.json +0 -1
  221. package/examples/generated-schemas/simple.schema.json +0 -1
  222. package/examples/generated-schemas/simpletypes.schema.json +0 -1
  223. package/examples/generated-schemas/stabilizing.schema.json +0 -1
  224. package/examples/generated-schemas/subdir/subdir.schema.json +0 -1
  225. package/examples/generated-schemas/typearrays.schema.json +0 -1
  226. package/examples/schemas/abstract.schema.json +0 -44
  227. package/examples/schemas/arrays.schema.json +0 -185
  228. package/examples/schemas/complex.schema.json +0 -123
  229. package/examples/schemas/constants.schema.json +0 -25
  230. package/examples/schemas/custom.schema.json +0 -41
  231. package/examples/schemas/deepextending.schema.json +0 -37
  232. package/examples/schemas/definitions.description.md +0 -17
  233. package/examples/schemas/definitions.schema.json +0 -46
  234. package/examples/schemas/enums.schema.json +0 -42
  235. package/examples/schemas/example.example.1.json +0 -4
  236. package/examples/schemas/example.schema.json +0 -29
  237. package/examples/schemas/examples.example.1.json +0 -4
  238. package/examples/schemas/examples.example.2.json +0 -4
  239. package/examples/schemas/examples.schema.json +0 -32
  240. package/examples/schemas/extending.schema.json +0 -38
  241. package/examples/schemas/extensible.schema.json +0 -38
  242. package/examples/schemas/identifiable.schema.json +0 -22
  243. package/examples/schemas/join.schema.json +0 -88
  244. package/examples/schemas/nestedobj.schema.json +0 -35
  245. package/examples/schemas/pattern.schema.json +0 -21
  246. package/examples/schemas/simple.schema.json +0 -22
  247. package/examples/schemas/simpletypes.schema.json +0 -151
  248. package/examples/schemas/stabilizing.schema.json +0 -23
  249. package/examples/schemas/subdir/subdir.schema.json +0 -29
  250. package/examples/schemas/typearrays.schema.json +0 -39
  251. package/examples/status.md +0 -3
  252. package/test/api.test.js +0 -55
  253. package/test/cyclicSchemaIntegration.test.js +0 -87
  254. package/test/fixtures/additionalprops/additionalprops.schema.json +0 -6
  255. package/test/fixtures/additionalprops/arrays.schema.json +0 -9
  256. package/test/fixtures/arrays/arrays.schema.json +0 -201
  257. package/test/fixtures/arrays/tuple.schema.json +0 -35
  258. package/test/fixtures/content/html.schema.json +0 -5
  259. package/test/fixtures/content/jwt.schema.json +0 -26
  260. package/test/fixtures/content/png.schema.json +0 -6
  261. package/test/fixtures/cyclic/one.description.md +0 -1
  262. package/test/fixtures/cyclic/one.example.1.json +0 -1
  263. package/test/fixtures/cyclic/one.schema.json +0 -17
  264. package/test/fixtures/cyclic/three.schema.json +0 -17
  265. package/test/fixtures/cyclic/two.schema.json +0 -17
  266. package/test/fixtures/deadref/deadref.schema.json +0 -6
  267. package/test/fixtures/enums/arrayenums.schema.json +0 -29
  268. package/test/fixtures/enums/enums.schema.json +0 -29
  269. package/test/fixtures/example/example.schema.json +0 -52
  270. package/test/fixtures/format/format.schema.json +0 -25
  271. package/test/fixtures/identifiable/identifiable.schema.json +0 -22
  272. package/test/fixtures/not/not.schema.json +0 -7
  273. package/test/fixtures/null/null.schema.json +0 -14
  274. package/test/fixtures/nullable/array.schema.json +0 -17
  275. package/test/fixtures/readme-1/abstract.schema.json +0 -50
  276. package/test/fixtures/readme-1/complex.schema.json +0 -118
  277. package/test/fixtures/readme-1/simple.schema.json +0 -30
  278. package/test/fixtures/skipproperties/complete.schema.json +0 -29
  279. package/test/fixtures/stringformats/simpletypes.schema.json +0 -211
  280. package/test/fixtures/title/meta.schema.json +0 -53
  281. package/test/fixtures/type/button.schema.json +0 -28
  282. package/test/fixtures/type/type.schema.json +0 -20
  283. package/test/fixtures/types/merged.schema.json +0 -10
  284. package/test/fixtures/types/object.schema.json +0 -3
  285. package/test/fixtures/types/objectorarray.schema.json +0 -3
  286. package/test/fixtures/types/undefined.schema.json +0 -3
  287. package/test/fixtures/types/wrong.schema.json +0 -6
  288. package/test/formatting.test.js +0 -59
  289. package/test/markdownBuilder.test.js +0 -441
  290. package/test/readmeBuilder.test.js +0 -106
  291. package/test/schemaProxy.test.js +0 -187
  292. package/test/testUtils.js +0 -88
  293. package/test/testintegration.test.js +0 -65
  294. package/test/traverseSchema.test.js +0 -111
  295. package/test/zSchemaCoverage.test.js +0 -186
@@ -1,118 +0,0 @@
1
- {
2
- "meta:license": [
3
- "Copyright 2017 Adobe Systems Incorporated. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the 'License');",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0"
7
- ],
8
- "$schema": "http://json-schema.org/draft-06/schema#",
9
- "$id": "https://example.com/schemas/complex",
10
- "title": "Complex References",
11
- "type": "object",
12
- "readOnly": true,
13
- "description": "This is an example schema that uses types defined in other schemas.",
14
- "definitions": {
15
- "definitionnamed": {
16
- "title": "definitionnamed",
17
- "type": "object",
18
- "additionalProperties": true,
19
- "properties": {}
20
- }
21
- },
22
- "properties": {
23
- "refabstract": {
24
- "$ref": "https://example.com/schemas/abstract#/definitions/first",
25
- "version": "1.0.0",
26
- "testProperty": "test"
27
- },
28
- "refnamed": {
29
- "$ref": "https://example.com/schemas/simple",
30
- "version": "1.0.0",
31
- "testProperty": "test"
32
- },
33
- "refrefed": {
34
- "$ref": "#/properties/refnamed",
35
- "version": "1.0.0",
36
- "testProperty": "test"
37
- },
38
- "refdefinition": {
39
- "$ref": "#/definitions/definitionnamed"
40
- },
41
- "refobj": {
42
- "type": "object",
43
- "properties": {
44
- "foo": {
45
- "$ref": "https://example.com/schemas/simple",
46
- "version": "1.0.0",
47
- "testProperty": "test"
48
- }
49
- },
50
- "version": "1.0.0",
51
- "testProperty": "test"
52
- },
53
- "refnestedobj": {
54
- "type": "object",
55
- "properties": {
56
- "refobj": {
57
- "type": "object",
58
- "version": "1.0.0",
59
- "testProperty": "test",
60
- "properties": {
61
- "foo": {
62
- "$ref": "https://example.com/schemas/simple",
63
- "version": "1.0.0",
64
- "testProperty": "test"
65
- }
66
- }
67
- }
68
- },
69
- "version": "1.0.0",
70
- "testProperty": "test"
71
- },
72
- "or": {
73
- "description": "String or number…",
74
- "anyOf": [
75
- { "type":"string" },
76
- { "type":"number", "minimum": 0}
77
- ],
78
- "version": "1.0.0",
79
- "testProperty": "test"
80
- },
81
- "and": {
82
- "description": "Number in a range",
83
- "allOf": [
84
- { "type":"number", "maximum": 10 },
85
- { "type":"number", "minimum": 0}
86
- ],
87
- "version": "1.0.0",
88
- "testProperty": "test"
89
- },
90
- "xor": {
91
- "description": "Exclusive choice.",
92
- "oneOf": [
93
- { "type":"number", "maximum": 0 },
94
- { "type":"number", "minimum": 10}
95
- ],
96
- "version": "1.0.0",
97
- "testProperty": "test"
98
- }
99
- },
100
- "required": [
101
- "refabstract"
102
- ],
103
- "additionalProperties": {
104
- "type":"boolean"
105
- },
106
- "patternProperties": {
107
- "int.*": {
108
- "type": "integer",
109
- "version": "1.0.0",
110
- "testProperty": "test"
111
- },
112
- "str.*": {
113
- "type":"string",
114
- "version": "1.0.0",
115
- "testProperty": "test"
116
- }
117
- }
118
- }
@@ -1,30 +0,0 @@
1
- {
2
- "meta:license": [
3
- "Copyright 2017 Adobe Systems Incorporated. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the 'License');",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0"
7
- ],
8
- "$schema": "http://json-schema.org/draft-06/schema#",
9
- "$id": "https://example.com/schemas/simple",
10
- "title": "Simple",
11
- "$comment": "I'm just a simple schema, living a simple life.",
12
- "deprecated": true,
13
- "writeOnly": true,
14
- "description": "This is a *very* simple example of a JSON schema. There is only one property.",
15
- "type": "object",
16
- "properties": {
17
- "id": {
18
- "type": "string",
19
- "format": "uri",
20
- "description": "A unique identifier given to every addressable thing.",
21
- "version": "1.0.0",
22
- "testProperty": "test"
23
- },
24
- "name": {
25
- "type": "string",
26
- "default": "Simply Untitled",
27
- "$comment": "This should be here"
28
- }
29
- }
30
- }
@@ -1,29 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Complete JSON Schema",
4
- "description": "Testing for skipped props",
5
- "type": "object",
6
- "properties": {
7
- "foo": {
8
- "type": "string"
9
- },
10
- "bar": {
11
- "description": "Configures the bar property",
12
- "type": "boolean",
13
- "default": "true"
14
- },
15
- "foobar": {
16
- "description": "Overwrite the bar value",
17
- "examples":[{
18
- "bar": "true",
19
- "foobar": "no"
20
- }],
21
- "type": "string",
22
- "format": "yes/no"
23
- }
24
- },
25
- "additionalProperties": false,
26
- "required": [
27
- "bar"
28
- ]
29
- }
@@ -1,211 +0,0 @@
1
- {
2
- "meta:license": [
3
- "Copyright 2017 Adobe Systems Incorporated. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the 'License');",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0"
7
- ],
8
- "$schema": "http://json-schema.org/draft-06/schema#",
9
- "$id": "https://example.com/schemas/simpletypes",
10
- "title": "Simple Types",
11
- "type": "object",
12
- "description": "This is an example schema with examples for multiple types and their constraints.",
13
- "properties": {
14
- "string_unconstrained": {
15
- "type": "string",
16
- "description": "A simple string, without any constraints.",
17
- "examples": ["bar"],
18
- "version": "1.0.0",
19
- "testProperty": "test"
20
- },
21
- "string_length": {
22
- "type": "string",
23
- "description": "A string with minumum and maximum length",
24
- "examples": ["bar", "baz"],
25
- "minLength": 3,
26
- "maxLength": 3,
27
- "version": "1.0.0",
28
- "testProperty": "test"
29
- },
30
- "string_pattern": {
31
- "type": "string",
32
- "description": "A string following a regular expression",
33
- "pattern": "^ba.$",
34
- "examples": ["bar", "baz", "bat"],
35
- "meta:enum": {
36
- "baa": "the sounds of sheeps",
37
- "bad": "German bathroom",
38
- "bag": "holding device",
39
- "bah": "humbug!",
40
- "bam": "a loud sound",
41
- "ban": "don't do this",
42
- "bap": "a British soft bread roll",
43
- "bas": "from ancient Egyptian religion, an aspect of the soul",
44
- "bat": "…out of hell",
45
- "bay": ", sitting by the dock of the"
46
- },
47
- "version": "1.0.0",
48
- "testProperty": "test"
49
- },
50
- "string_pattern_noexample": {
51
- "type": "string",
52
- "description": "A string following a regular expression",
53
- "pattern": "^ba.$",
54
- "version": "1.0.0",
55
- "testProperty": "test"
56
- },
57
- "string_pattern_singleexample": {
58
- "type": "string",
59
- "description": "A string following a regular expression",
60
- "pattern": "^ba.$",
61
- "examples": ["bar"],
62
- "version": "1.0.0",
63
- "testProperty": "test"
64
- },
65
- "string_date": {
66
- "type": "string",
67
- "description": "A date-like string.",
68
- "format": "date-time",
69
- "version": "1.0.0",
70
- "testProperty": "test"
71
- },
72
- "string_date_only": {
73
- "type": "string",
74
- "format": "date"
75
- },
76
- "string_duration": {
77
- "type": "string",
78
- "format": "duration"
79
- },
80
- "string_idnemail": {
81
- "type": "string",
82
- "format": "idn-email"
83
- },
84
- "string_idnhostname": {
85
- "type": "string",
86
- "format": "idn-hostname"
87
- },
88
- "string_iri": {
89
- "type": "string",
90
- "format": "iri"
91
- },
92
- "string_iri_reference": {
93
- "type": "string",
94
- "format": "iri-reference"
95
- },
96
- "string_json_pointer": {
97
- "type": "string",
98
- "format": "json-pointer"
99
- },
100
- "string_json_relative_pointer": {
101
- "type": "string",
102
- "format": "relative-json-pointer"
103
- },
104
- "string_time": {
105
- "type": "string",
106
- "format": "time"
107
- },
108
- "string_uri_template": {
109
- "type": "string",
110
- "format": "uri-template"
111
- },
112
- "string_uri_reference": {
113
- "type": "string",
114
- "format": "uri-reference"
115
- },
116
- "string_uuid": {
117
- "type": "string",
118
- "format": "uuid"
119
- },
120
- "string_regex": {
121
- "type": "string",
122
- "format": "regex"
123
- },
124
- "string_email": {
125
- "type": "string",
126
- "description": "An email-like string.",
127
- "format": "email",
128
- "version": "1.0.0",
129
- "testProperty": "test"
130
- },
131
- "string_hostname": {
132
- "type": "string",
133
- "description": "A hostname-like string.",
134
- "format": "hostname",
135
- "version": "1.0.0",
136
- "testProperty": "test"
137
- },
138
- "string_ipv4": {
139
- "type": "string",
140
- "description": "An IPv4-like string.",
141
- "format": "ipv4",
142
- "version": "1.0.0",
143
- "testProperty": "test"
144
- },
145
- "string_ipv6": {
146
- "type": "string",
147
- "description": "An IPv6-like string.",
148
- "format": "ipv6",
149
- "version": "1.0.0",
150
- "testProperty": "test"
151
- },
152
- "string_uri": {
153
- "type": "string",
154
- "description": "A URI.",
155
- "format": "uri",
156
- "version": "1.0.0",
157
- "testProperty": "test"
158
- },
159
- "string_other": {
160
- "type": "string",
161
- "description": "A URI.",
162
- "format": "unknown",
163
- "version": "1.0.0",
164
- "testProperty": "test"
165
- },
166
- "number_unconstrained": {
167
- "type": "number",
168
- "description": "Just a number",
169
- "version": "1.0.0",
170
- "testProperty": "test"
171
- },
172
- "interger_unconstrained": {
173
- "type": "integer",
174
- "description": "Just a whole number. I don't like fractions.",
175
- "version": "1.0.0",
176
- "testProperty": "test"
177
- },
178
- "interger_constrained": {
179
- "type": "integer",
180
- "description": "Just a whole number. I don't like fractions. Don't get too small",
181
- "minimum": 10,
182
- "version": "1.0.0",
183
- "testProperty": "test"
184
- },
185
- "number_constrained": {
186
- "type": "number",
187
- "description": "Just a number. Don't get too big.",
188
- "exclusiveMaximum": 10,
189
- "exclusiveMinimum": 0,
190
- "version": "1.0.0",
191
- "testProperty": "test"
192
- },
193
- "integer_threes": {
194
- "type":"integer",
195
- "description": "Guess what number is valid",
196
- "multipleOf": 3,
197
- "minimum": 2,
198
- "maximum": 4,
199
- "version": "1.0.0",
200
- "testProperty": "test"
201
- },
202
- "yesno": {
203
- "type": "boolean",
204
- "version": "1.0.0",
205
- "testProperty": "test"
206
- }
207
- },
208
- "required": [
209
- "yesno"
210
- ]
211
- }
@@ -1,53 +0,0 @@
1
- {
2
- "meta:license": [
3
- "Copyright 2018 Adobe. All rights reserved.",
4
- "This file is licensed to you under the Apache License, Version 2.0 (the \"License\");",
5
- "you may not use this file except in compliance with the License. You may obtain a copy",
6
- "of the License at http://www.apache.org/licenses/LICENSE-2.0",
7
- "",
8
- "Unless required by applicable law or agreed to in writing, software distributed under",
9
- "the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS",
10
- "OF ANY KIND, either express or implied. See the License for the specific language",
11
- "governing permissions and limitations under the License."
12
- ],
13
- "$id": "https://ns.adobe.com/helix/pipeline/meta",
14
- "$schema": "http://json-schema.org/draft-07/schema#",
15
- "title": "Meta",
16
- "meta:status": "stabilizing",
17
- "description": "Content and Section Metadata Properties",
18
- "definitions": {
19
- "meta": {
20
- "type": ["null", "object"],
21
- "properties": {
22
- "class": {
23
- "type": "string",
24
- "description": "The CSS class to use for the section instead of the default `hlx-section` one"
25
- },
26
- "tagname": {
27
- "type": "string",
28
- "description": "The element tag name to use for the section instead of the default `div` one (i.e. `section`, `main`, `aside`)"
29
- },
30
- "types": {
31
- "type": "array",
32
- "description": "The inferred class names for the section",
33
- "items": {
34
- "type": "string"
35
- }
36
- },
37
- "title": {
38
- "type": "string",
39
- "description": "Extracted title of the document"
40
- },
41
- "intro": {
42
- "type": "string",
43
- "description": "Extracted first paragraph of the document"
44
- },
45
- "image": {
46
- "type": "string",
47
- "format": "uri-reference",
48
- "description": "Path (can be relative) to the first image in the document"
49
- }
50
- }
51
- }
52
- }
53
- }
@@ -1,28 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-04/schema#",
3
- "$id": "http://www.example.com/schemas/components/Button.json",
4
- "type": "object",
5
- "title": "Button",
6
- "description": "Renders a Button.",
7
- "additionalProperties": false,
8
- "properties": {
9
- "properties": {
10
- "type": "object",
11
- "title": "Properties",
12
- "description": "Properties of Button.",
13
- "additionalProperties": false,
14
- "properties": {
15
- "type": {
16
- "type": "string",
17
- "enum": [
18
- "button",
19
- "submit",
20
- "reset"
21
- ],
22
- "title": "Type",
23
- "description": "The type of the Button (not used for anchors)."
24
- }
25
- }
26
- }
27
- }
28
- }
@@ -1,20 +0,0 @@
1
- {
2
- "type": "object",
3
- "title": "Properties",
4
- "description": "Properties of Button.",
5
-
6
- "additionalProperties": false,
7
- "properties": {
8
- "value": {
9
- "type": "string",
10
- "title": "Value",
11
- "description": "The value of the Button."
12
- },
13
- "type": {
14
- "type": "string",
15
- "enum": ["button", "submit", "reset"],
16
- "title": "Type",
17
- "description": "The type of the Button (not used for anchors)."
18
- }
19
- }
20
- }
@@ -1,10 +0,0 @@
1
- {
2
- "oneOf": [
3
- {
4
- "type": "string"
5
- },
6
- {
7
- "type": "array"
8
- }
9
- ]
10
- }
@@ -1,3 +0,0 @@
1
- {
2
- "type": "object"
3
- }
@@ -1,3 +0,0 @@
1
- {
2
- "type": ["object", "array"]
3
- }
@@ -1,3 +0,0 @@
1
- {
2
- "title": "You don't know what I am"
3
- }
@@ -1,6 +0,0 @@
1
- {
2
- "$id": "https://example.com/ns/wrong",
3
- "type": {
4
- "this": "is wrong"
5
- }
6
- }
@@ -1,59 +0,0 @@
1
- /*
2
- * Copyright 2019 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
- /* eslint-env mocha */
13
- /* eslint-disable no-unused-expressions */
14
- const assert = require('assert');
15
- const s = require('../lib/symbols');
16
- const { gentitle, gendescription } = require('../lib/formattingTools');
17
-
18
- describe('Testing formatting tools: gettitle', () => {
19
- it('robust for undefined', () => {
20
- assert.strictEqual(gentitle('foo'), 'Untitled schema');
21
- });
22
- it('robust for non array', () => {
23
- assert.strictEqual(gentitle('foo'), 'Untitled schema');
24
- });
25
- it('robust for undefined array', () => {
26
- assert.strictEqual(gentitle([undefined]), 'Untitled schema');
27
- });
28
- it('robust for larger undefined array', () => {
29
- assert.strictEqual(gentitle([undefined, undefined]), 'Untitled schema');
30
- });
31
- it('returns single first title', () => {
32
- assert.strictEqual(gentitle(['Hello world schema']), 'Hello world schema');
33
- });
34
- it('returns last title', () => {
35
- assert.strictEqual(gentitle([1, 2, 3, 'Hello world schema']), 'Hello world schema');
36
- });
37
- it('returns title with type', () => {
38
- assert.strictEqual(gentitle(['Hello world schema', undefined], 'string'),
39
- 'Untitled string in Hello world schema');
40
- });
41
- it('returns title with for undefined type', () => {
42
- assert.strictEqual(gentitle(['Hello world schema', undefined]),
43
- 'Untitled undefined type in Hello world schema');
44
- });
45
- });
46
-
47
- describe('Testing formatting tools: gendescription', () => {
48
- it('robust for undefined', () => {
49
- assert.strictEqual(gendescription(), '');
50
- });
51
-
52
- it('works with meta', () => {
53
- assert.strictEqual(gendescription({
54
- [s.meta]: {
55
- shortdescription: 'Hello, world',
56
- },
57
- }), 'Hello, world');
58
- });
59
- });