@tryghost/admin-api-schema 2.16.0 → 3.1.0

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 (77) hide show
  1. package/README.md +2 -3
  2. package/lib/admin-api-schema.js +12 -92
  3. package/lib/{canary → schemas}/README.md +1 -1
  4. package/lib/{v3 → schemas}/images-upload.json +2 -2
  5. package/lib/{v2 → schemas}/images.json +1 -1
  6. package/lib/{canary → schemas}/index.js +0 -0
  7. package/lib/{v3 → schemas}/labels-add.json +2 -2
  8. package/lib/{v3 → schemas}/labels-edit.json +2 -2
  9. package/lib/{v3 → schemas}/labels.json +1 -1
  10. package/lib/{canary → schemas}/media-upload.json +2 -2
  11. package/lib/{canary → schemas}/media.json +1 -1
  12. package/lib/{v3 → schemas}/members-add.json +2 -2
  13. package/lib/{canary → schemas}/members-edit.json +7 -4
  14. package/lib/{canary → schemas}/members-upload.json +1 -1
  15. package/lib/{canary → schemas}/members.json +4 -1
  16. package/lib/{v3 → schemas}/pages-add.json +2 -2
  17. package/lib/{v3 → schemas}/pages-edit.json +2 -2
  18. package/lib/{canary → schemas}/pages.json +1 -1
  19. package/lib/{v3 → schemas}/posts-add.json +2 -2
  20. package/lib/{v3 → schemas}/posts-edit.json +2 -2
  21. package/lib/{canary → schemas}/posts.json +1 -1
  22. package/lib/{canary → schemas}/products-add.json +2 -2
  23. package/lib/{canary → schemas}/products-edit.json +2 -2
  24. package/lib/{canary → schemas}/products.json +3 -3
  25. package/lib/{v3 → schemas}/snippets-add.json +2 -2
  26. package/lib/{v3 → schemas}/snippets-edit.json +2 -2
  27. package/lib/{v3 → schemas}/snippets.json +1 -1
  28. package/lib/{v3 → schemas}/tags-add.json +2 -2
  29. package/lib/{v2 → schemas}/tags-edit.json +2 -2
  30. package/lib/{v3 → schemas}/tags.json +1 -1
  31. package/lib/{canary → schemas}/tiers-add.json +2 -2
  32. package/lib/{canary → schemas}/tiers-edit.json +2 -2
  33. package/lib/{canary → schemas}/tiers.json +5 -2
  34. package/lib/{v3 → schemas}/webhooks-add.json +2 -2
  35. package/lib/{v3 → schemas}/webhooks-edit.json +1 -1
  36. package/lib/{v3 → schemas}/webhooks.json +1 -1
  37. package/lib/utils/json-schema.js +1 -0
  38. package/package.json +2 -2
  39. package/lib/canary/images-upload.json +0 -7
  40. package/lib/canary/images.json +0 -23
  41. package/lib/canary/labels-add.json +0 -22
  42. package/lib/canary/labels-edit.json +0 -17
  43. package/lib/canary/labels.json +0 -39
  44. package/lib/canary/members-add.json +0 -21
  45. package/lib/canary/pages-add.json +0 -21
  46. package/lib/canary/pages-edit.json +0 -21
  47. package/lib/canary/posts-add.json +0 -21
  48. package/lib/canary/posts-edit.json +0 -21
  49. package/lib/canary/snippets-add.json +0 -22
  50. package/lib/canary/snippets-edit.json +0 -22
  51. package/lib/canary/snippets.json +0 -39
  52. package/lib/canary/tags-add.json +0 -22
  53. package/lib/canary/tags-edit.json +0 -17
  54. package/lib/canary/tags.json +0 -112
  55. package/lib/canary/webhooks-add.json +0 -21
  56. package/lib/canary/webhooks-edit.json +0 -74
  57. package/lib/canary/webhooks.json +0 -67
  58. package/lib/v2/README.md +0 -8
  59. package/lib/v2/images-upload.json +0 -7
  60. package/lib/v2/index.js +0 -9
  61. package/lib/v2/pages-add.json +0 -21
  62. package/lib/v2/pages-edit.json +0 -21
  63. package/lib/v2/pages.json +0 -250
  64. package/lib/v2/posts-add.json +0 -21
  65. package/lib/v2/posts-edit.json +0 -21
  66. package/lib/v2/posts.json +0 -250
  67. package/lib/v2/tags-add.json +0 -22
  68. package/lib/v2/tags.json +0 -69
  69. package/lib/v3/README.md +0 -8
  70. package/lib/v3/images.json +0 -23
  71. package/lib/v3/index.js +0 -18
  72. package/lib/v3/members-edit.json +0 -74
  73. package/lib/v3/members-upload.json +0 -48
  74. package/lib/v3/members.json +0 -109
  75. package/lib/v3/pages.json +0 -250
  76. package/lib/v3/posts.json +0 -263
  77. package/lib/v3/tags-edit.json +0 -17
package/README.md CHANGED
@@ -34,7 +34,7 @@ jsonSchema.get('tags-edit');
34
34
  /*
35
35
  > {
36
36
  '$schema': 'http://json-schema.org/draft-07/schema#',
37
- '$id': 'tags.edit.canary',
37
+ '$id': 'tags.edit',
38
38
  title: 'tags.edit',
39
39
  description: 'Schema for tags.edit',
40
40
  type: 'object',
@@ -65,8 +65,7 @@ When used from Ghost core in validation layer:
65
65
  const jsonSchema = require('@tryghost/admin-api-schema');
66
66
  const validate = async (apiConfig, frame) => await jsonSchema.validate({
67
67
  data: frame.data,
68
- schema: `${apiConfig.docName}-${apiConfig.method}`,
69
- version: 'canary'
68
+ schema: `${apiConfig.docName}-${apiConfig.method}`
70
69
  });
71
70
  ```
72
71
 
@@ -3,13 +3,12 @@ const jsonSchema = require('./utils/json-schema');
3
3
 
4
4
  /**
5
5
  *
6
- * @param {'v2'|'v3'|'canary'} version - API's JSON schema version to check against
7
- * @param {string} name -JSON schema to retreive from "version" folder
6
+ * @param {string} name -JSON schema to retreive from "schemas" folder
8
7
  *
9
8
  * @returns {Object} - JSON schema file content
10
9
  */
11
- const getJSONDefinition = (version, name) => {
12
- const definitionPath = `./${version}/${name}`;
10
+ const getJSONDefinition = (name) => {
11
+ const definitionPath = `./schemas/${name}`;
13
12
 
14
13
  try {
15
14
  return require(definitionPath);
@@ -21,37 +20,12 @@ const getJSONDefinition = (version, name) => {
21
20
  };
22
21
 
23
22
  /**
24
- * Resolves with a schema definition content. At the moment it contains unresolved `$ref` statements.
25
- * This method needs some additional work to be useful for outside consumer - contain resolved '$ref'.
26
- *
27
- * @param {Object} options
28
- * @param {'v2'|'v3'|'canary'} - API's JSON schema version to check against
29
- * @param {string} options.schema - name of JSON schema definition, comes from available optios returned by list()
30
- */
31
- const get = ({version, schema}) => {
32
- if (!list({version}).includes(schema)) {
33
- return null;
34
- }
35
-
36
- return getJSONDefinition(version, schema);
37
- };
38
-
39
- /**
40
- * Lists available JSON schema definitions for provided version
41
- *
42
- * @param {Object} options
43
- * @param {'v2'|'v3'|'v4'|'canary'} - API's JSON schema version to check against
23
+ * Lists available JSON schema definitions
44
24
  *
45
25
  * @returns {string[]} - list of available JSON schema definitions
46
26
  */
47
- const list = ({version}) => {
48
- if (version === 'v2') {
49
- return require('./v2');
50
- } else if (version === 'v3') {
51
- return require('./v3');
52
- } else if (version === 'v4' || version === 'canary') {
53
- return require('./canary');
54
- }
27
+ const list = () => {
28
+ return require('./schemas');
55
29
  };
56
30
 
57
31
  /**
@@ -59,7 +33,6 @@ const list = ({version}) => {
59
33
  *
60
34
  * @typedef {Object} ValidateOptions
61
35
  * @property {Object} options.data - data to validate
62
- * @property {'v2'|'v3'|'canary'} options.version - API version to data belongs to, e.g.: 'v2', 'canary'
63
36
  * @property {string} [options.schema] - name of the schema to validate against. Available schema names are returned by list() function
64
37
  * @property {string} [options.definition] - name of the definition where schema belongs
65
38
  */
@@ -71,8 +44,8 @@ const list = ({version}) => {
71
44
  *
72
45
  * @returns {Promise} - resolves a promise if validation is successful and rejects with error details otherwise
73
46
  */
74
- const validate = ({data, version, schema = '', definition = schema.split('-')[0]}) => {
75
- const schemaJSON = get({schema, version});
47
+ const validate = ({data, schema, definition = schema?.split('-')[0]}) => {
48
+ const schemaJSON = getJSONDefinition(schema);
76
49
 
77
50
  if (!schemaJSON) {
78
51
  throw new errors.IncorrectUsageError({
@@ -81,66 +54,13 @@ const validate = ({data, version, schema = '', definition = schema.split('-')[0]
81
54
  });
82
55
  }
83
56
 
84
- const definitionJSON = getJSONDefinition(version, definition);
57
+ const definitionJSON = getJSONDefinition(definition);
85
58
 
86
59
  return jsonSchema.validate(schemaJSON, definitionJSON, data);
87
60
  };
88
61
 
89
- /**
90
- * Resolves version into "internal" one.
91
- * 'canary' is used to identify latest available version. Currently it's 'v3' and once there's
92
- * next version introduced - 'v4' should be resolved to 'canary', and 'v3' should be returned as is.
93
- *
94
- * @param {'v2'|'v3'|'v4'|'canary'} - version to resolve into internaly available version
95
- *
96
- * @returns {'v2'|'v3'|'canary'} - resolved version
97
- */
98
- const resolveVersion = (version) => {
99
- switch (version) {
100
- case 'canary':
101
- case 'v4':
102
- return 'canary';
103
- case 'v3':
104
- return 'v3';
105
- case 'v2':
106
- return 'v2';
107
- default:
108
- throw new errors.IncorrectUsageError({
109
- message: `Unrecognised version ${version}.`
110
- });
111
- }
112
- };
113
-
114
- /**
115
- * Versioned version of 'get' method, which returns a JSON schema definition if found
116
- *
117
- * @param {string} schema - name of JSON schema definitions
118
- * @param {string} version - API's JSON schema version to check against
119
- *
120
- * @returns {Object|null} JSON schema definition or null if it's not found
121
- */
122
- const versionedGet = (schema, version = 'v4') => get({schema, version: resolveVersion(version)});
123
-
124
- /**
125
- * Versioned version of 'list' method, which lisists available JSON schema definitions for provided version
126
- *
127
- * @param {string} version - API's JSON schema version to check against
128
- *
129
- * @returns {string[]} - list of available JSON schema definitions
130
- */
131
- const versionedList = (version = 'v4') => list({version: resolveVersion(version)});
132
-
133
- /**
134
- * Versioned version of 'validate' method, which validates objects against predefined JSON Schema
135
- *
136
- * @param {ValidateOptions} options
137
- *
138
- * @returns {Promise} - resolves a promise if validation is successful and rejects with error details otherwise
139
- */
140
- const versionedValidate = options => validate(Object.assign(options, {version: resolveVersion(options.version || 'v4')}));
141
-
142
62
  module.exports = {
143
- get: versionedGet,
144
- list: versionedList,
145
- validate: versionedValidate
63
+ get: getJSONDefinition,
64
+ list: list,
65
+ validate: validate
146
66
  };
@@ -2,7 +2,7 @@
2
2
 
3
3
  When adding a new schema or definition following naming convention should be followed:
4
4
  1. Name the file containing JSON definitions in the same way as resource is named in the API (aka "docName" in controller config). For example, for [tags](https://github.com/TryGhost/Ghost/blob/2a921b86598184fcd5a2d95fefae4283bba1042a/core/server/api/canary/tags.js#L9) the definitions file would be `tags.json`
5
- 2. Name the file containing JSON schema (which usually references "definitions") using following convention `{resourceName}-{methodName}.json`. For example, for [tags.edit](https://github.com/TryGhost/Ghost/blob/master/core/server/api/canary/tags.js#L89) method file would be named `tags-edit.json`
5
+ 2. Name the file containing JSON schema (which usually references "definitions") using following convention `{resourceName}-{methodName}.json`. For example, for [tags.edit](https://github.com/TryGhost/Ghost/blob/7252f03824fff38564e4fa759a181b6228e094b2/core/server/api/canary/tags.js#L89) method file would be named `tags-edit.json`
6
6
  3. Update `index.js` list with a new definition name
7
7
 
8
8
  The need to have separate "definitions" and "schema" files comes from [schema reusability pattern](https://cswr.github.io/JsonSchema/spec/definitions_references/) that JSON schema allows for through $ref keyword. In some cases, the pattern doesn't quite work out because of limitations of the syntax (cannot override parts of referenced definition). Generally try to reuse as much schema as possible to avoid duplication unless it becomes painful to do so.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "images.upload.v3",
3
+ "$id": "images.upload",
4
4
  "title": "images.upload",
5
5
  "description": "Schema for images.upload",
6
- "$ref": "images.v3#/definitions/image"
6
+ "$ref": "images#/definitions/image"
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "images.v2",
3
+ "$id": "images",
4
4
  "title": "images",
5
5
  "description": "Base images definitions",
6
6
  "definitions": {
File without changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "labels.add.v3",
3
+ "$id": "labels.add",
4
4
  "title": "labels.add",
5
5
  "description": "Schema for labels.add",
6
6
  "type": "object",
@@ -13,7 +13,7 @@
13
13
  "additionalProperties": false,
14
14
  "items": {
15
15
  "type": "object",
16
- "allOf": [{ "$ref": "labels.v3#/definitions/label" }],
16
+ "allOf": [{ "$ref": "labels#/definitions/label" }],
17
17
  "required": ["name"]
18
18
  }
19
19
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "labels.edit.v3",
3
+ "$id": "labels.edit",
4
4
  "title": "labels.edit",
5
5
  "description": "Schema for labels.edit",
6
6
  "type": "object",
@@ -10,7 +10,7 @@
10
10
  "type": "array",
11
11
  "minItems": 1,
12
12
  "maxItems": 1,
13
- "items": { "$ref": "labels.v3#/definitions/label" }
13
+ "items": { "$ref": "labels#/definitions/label" }
14
14
  }
15
15
  },
16
16
  "required": ["labels"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "labels.v3",
3
+ "$id": "labels",
4
4
  "title": "labels",
5
5
  "description": "Base labels definitions",
6
6
  "definitions": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "media.upload.canary",
3
+ "$id": "media.upload",
4
4
  "title": "media.upload",
5
5
  "description": "Schema for media.upload",
6
- "$ref": "media.canary#/definitions/media"
6
+ "$ref": "media#/definitions/media"
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "media.canary",
3
+ "$id": "media",
4
4
  "title": "media",
5
5
  "description": "Base media definitions",
6
6
  "definitions": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "members.add.v3",
3
+ "$id": "members.add",
4
4
  "title": "members.add",
5
5
  "description": "Schema for members.add",
6
6
  "type": "object",
@@ -12,7 +12,7 @@
12
12
  "maxItems": 1,
13
13
  "items": {
14
14
  "type": "object",
15
- "allOf": [{ "$ref": "members.v3#/definitions/member" }],
15
+ "allOf": [{ "$ref": "members#/definitions/member" }],
16
16
  "required": ["email"]
17
17
  }
18
18
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "members.edit.canary",
3
+ "$id": "members.edit",
4
4
  "title": "members.edit",
5
5
  "description": "Schema for members.edit",
6
6
  "type": "object",
@@ -46,13 +46,16 @@
46
46
  "strip": true
47
47
  },
48
48
  "products": {
49
- "$ref": "members.canary#/definitions/member-products"
49
+ "$ref": "members#/definitions/member-products"
50
+ },
51
+ "tiers": {
52
+ "$ref": "members#/definitions/member-products"
50
53
  },
51
54
  "newsletters": {
52
- "$ref": "members.canary#/definitions/member-newsletters"
55
+ "$ref": "members#/definitions/member-newsletters"
53
56
  },
54
57
  "labels": {
55
- "$ref": "members.canary#/definitions/member-labels"
58
+ "$ref": "members#/definitions/member-labels"
56
59
  },
57
60
  "email_count": {
58
61
  "strip": true
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "members.upload.canary",
3
+ "$id": "members.upload",
4
4
  "title": "members.upload",
5
5
  "description": "Schema for members.upload",
6
6
  "type": "array",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "members.canary",
3
+ "$id": "members",
4
4
  "title": "members",
5
5
  "description": "Base members definitions",
6
6
  "definitions": {
@@ -48,6 +48,9 @@
48
48
  "products": {
49
49
  "$ref": "#/definitions/member-products"
50
50
  },
51
+ "tiers": {
52
+ "$ref": "#/definitions/member-products"
53
+ },
51
54
  "newsletters": {
52
55
  "$ref": "#/definitions/member-newsletters"
53
56
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "pages.add.v3",
3
+ "$id": "pages.add",
4
4
  "title": "pages.add",
5
5
  "description": "Schema for pages.add",
6
6
  "type": "object",
@@ -12,7 +12,7 @@
12
12
  "maxItems": 1,
13
13
  "items": {
14
14
  "type": "object",
15
- "allOf": [{ "$ref": "pages.v3#/definitions/page" }],
15
+ "allOf": [{ "$ref": "pages#/definitions/page" }],
16
16
  "required": ["title"]
17
17
  }
18
18
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "pages.edit.v3",
3
+ "$id": "pages.edit",
4
4
  "title": "pages.edit",
5
5
  "description": "Schema for pages.edit",
6
6
  "type": "object",
@@ -12,7 +12,7 @@
12
12
  "maxItems": 1,
13
13
  "items": {
14
14
  "type": "object",
15
- "allOf": [{ "$ref": "pages.v3#/definitions/page" }],
15
+ "allOf": [{ "$ref": "pages#/definitions/page" }],
16
16
  "required": ["updated_at"]
17
17
  }
18
18
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "pages.canary",
3
+ "$id": "pages",
4
4
  "title": "pages",
5
5
  "description": "Base pages definitions",
6
6
  "definitions": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "posts.add.v3",
3
+ "$id": "posts.add",
4
4
  "title": "posts.add",
5
5
  "description": "Schema for posts.add",
6
6
  "type": "object",
@@ -12,7 +12,7 @@
12
12
  "maxItems": 1,
13
13
  "items": {
14
14
  "type": "object",
15
- "allOf": [{ "$ref": "posts.v3#/definitions/post" }],
15
+ "allOf": [{ "$ref": "posts#/definitions/post" }],
16
16
  "required": ["title"]
17
17
  }
18
18
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "posts.edit.v3",
3
+ "$id": "posts.edit",
4
4
  "title": "posts.edit",
5
5
  "description": "Schema for posts.edit",
6
6
  "type": "object",
@@ -12,7 +12,7 @@
12
12
  "maxItems": 1,
13
13
  "items": {
14
14
  "type": "object",
15
- "allOf": [{ "$ref": "posts.v3#/definitions/post" }],
15
+ "allOf": [{ "$ref": "posts#/definitions/post" }],
16
16
  "required": ["updated_at"]
17
17
  }
18
18
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "posts.canary",
3
+ "$id": "posts",
4
4
  "title": "posts",
5
5
  "description": "Base posts definitions",
6
6
  "definitions": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "products.add.canary",
3
+ "$id": "products.add",
4
4
  "title": "products.add",
5
5
  "description": "Schema for products.add",
6
6
  "type": "object",
@@ -11,7 +11,7 @@
11
11
  "minItems": 1,
12
12
  "maxItems": 1,
13
13
  "items": {
14
- "type": "products.canary#/definitions/product"
14
+ "type": "products#/definitions/product"
15
15
  }
16
16
  }
17
17
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "products.edit.canary",
3
+ "$id": "products.edit",
4
4
  "title": "products.edit",
5
5
  "description": "Schema for products.edit",
6
6
  "type": "object",
@@ -11,7 +11,7 @@
11
11
  "minItems": 1,
12
12
  "maxItems": 1,
13
13
  "items": {
14
- "type": "products.canary#/definitions/product"
14
+ "type": "products#/definitions/product"
15
15
  }
16
16
  }
17
17
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "products.canary",
3
+ "$id": "products",
4
4
  "title": "products",
5
5
  "description": "Base products definitions",
6
6
  "definitions": {
@@ -33,13 +33,13 @@
33
33
  "stripe_prices": {
34
34
  "type": ["array", "null"],
35
35
  "items": {
36
- "type": "producs.canary#/definitions/stripe_price"
36
+ "type": "producs#/definitions/stripe_price"
37
37
  }
38
38
  },
39
39
  "benefits": {
40
40
  "type": ["array", "null"],
41
41
  "items": {
42
- "type": "producs.canary#/definitions/product-benefit"
42
+ "type": "producs#/definitions/product-benefit"
43
43
  }
44
44
  }
45
45
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "snippets.add.v3",
3
+ "$id": "snippets.add",
4
4
  "title": "snippets.add",
5
5
  "description": "Schema for snippets.add",
6
6
  "type": "object",
@@ -13,7 +13,7 @@
13
13
  "additionalProperties": false,
14
14
  "items": {
15
15
  "type": "object",
16
- "allOf": [{ "$ref": "snippets.v3#/definitions/snippet" }],
16
+ "allOf": [{ "$ref": "snippets#/definitions/snippet" }],
17
17
  "required": ["name", "mobiledoc"]
18
18
  }
19
19
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "snippets.edit.v3",
3
+ "$id": "snippets.edit",
4
4
  "title": "snippets.edit",
5
5
  "description": "Schema for snippets.edit",
6
6
  "type": "object",
@@ -13,7 +13,7 @@
13
13
  "additionalProperties": false,
14
14
  "items": {
15
15
  "type": "object",
16
- "allOf": [{ "$ref": "snippets.v3#/definitions/snippet" }],
16
+ "allOf": [{ "$ref": "snippets#/definitions/snippet" }],
17
17
  "required": ["name", "mobiledoc"]
18
18
  }
19
19
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "snippets.v3",
3
+ "$id": "snippets",
4
4
  "title": "snippets",
5
5
  "description": "Base snippets definitions",
6
6
  "definitions": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "tags.add.v3",
3
+ "$id": "tags.add",
4
4
  "title": "tags.add",
5
5
  "description": "Schema for tags.add",
6
6
  "type": "object",
@@ -13,7 +13,7 @@
13
13
  "additionalProperties": false,
14
14
  "items": {
15
15
  "type": "object",
16
- "allOf": [{ "$ref": "tags.v3#/definitions/tag" }],
16
+ "allOf": [{ "$ref": "tags#/definitions/tag" }],
17
17
  "required": ["name"]
18
18
  }
19
19
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "tags.edit.v2",
3
+ "$id": "tags.edit",
4
4
  "title": "tags.edit",
5
5
  "description": "Schema for tags.edit",
6
6
  "type": "object",
@@ -10,7 +10,7 @@
10
10
  "type": "array",
11
11
  "minItems": 1,
12
12
  "maxItems": 1,
13
- "items": { "$ref": "tags.v2#/definitions/tag" }
13
+ "items": { "$ref": "tags#/definitions/tag" }
14
14
  }
15
15
  },
16
16
  "required": ["tags"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "tags.v3",
3
+ "$id": "tags",
4
4
  "title": "tags",
5
5
  "description": "Base tags definitions",
6
6
  "definitions": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "tiers.add.canary",
3
+ "$id": "tiers.add",
4
4
  "title": "tiers.add",
5
5
  "description": "Schema for tiers.add",
6
6
  "type": "object",
@@ -12,7 +12,7 @@
12
12
  "maxItems": 1,
13
13
  "items": {
14
14
  "type": "object",
15
- "allOf": [{ "$ref": "tiers.canary#/definitions/tier" }]
15
+ "allOf": [{ "$ref": "tiers#/definitions/tier" }]
16
16
  }
17
17
  }
18
18
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "tiers.edit.canary",
3
+ "$id": "tiers.edit",
4
4
  "title": "tiers.edit",
5
5
  "description": "Schema for tiers.edit",
6
6
  "type": "object",
@@ -12,7 +12,7 @@
12
12
  "maxItems": 1,
13
13
  "items": {
14
14
  "type": "object",
15
- "allOf": [{ "$ref": "tiers.canary#/definitions/tier" }]
15
+ "allOf": [{ "$ref": "tiers#/definitions/tier" }]
16
16
  }
17
17
  }
18
18
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "tiers.canary",
3
+ "$id": "tiers",
4
4
  "title": "tiers",
5
5
  "description": "Base Tier definitions",
6
6
  "definitions": {
@@ -9,12 +9,15 @@
9
9
  "type": "object",
10
10
  "additionalProperties": false,
11
11
  "properties": {
12
+ "id": {
13
+ "strip": true
14
+ },
12
15
  "name": {
13
16
  "type": "string",
14
17
  "maxLength": 191
15
18
  },
16
19
  "description": {
17
- "type": "string",
20
+ "type": ["string", "null"],
18
21
  "maxLength": 191
19
22
  },
20
23
  "slug": {