@tryghost/admin-api-schema 2.17.0 → 3.0.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.
- package/README.md +2 -3
- package/lib/admin-api-schema.js +12 -92
- package/lib/{canary → schemas}/README.md +1 -1
- package/lib/{v3 → schemas}/images-upload.json +2 -2
- package/lib/{v2 → schemas}/images.json +1 -1
- package/lib/{canary → schemas}/index.js +0 -0
- package/lib/{v3 → schemas}/labels-add.json +2 -2
- package/lib/{v3 → schemas}/labels-edit.json +2 -2
- package/lib/{v3 → schemas}/labels.json +1 -1
- package/lib/{canary → schemas}/media-upload.json +2 -2
- package/lib/{canary → schemas}/media.json +1 -1
- package/lib/{v3 → schemas}/members-add.json +2 -2
- package/lib/{canary → schemas}/members-edit.json +5 -5
- package/lib/{canary → schemas}/members-upload.json +1 -1
- package/lib/{canary → schemas}/members.json +1 -1
- package/lib/{v3 → schemas}/pages-add.json +2 -2
- package/lib/{v3 → schemas}/pages-edit.json +2 -2
- package/lib/{canary → schemas}/pages.json +1 -1
- package/lib/{v3 → schemas}/posts-add.json +2 -2
- package/lib/{v3 → schemas}/posts-edit.json +2 -2
- package/lib/{canary → schemas}/posts.json +1 -1
- package/lib/{canary → schemas}/products-add.json +2 -2
- package/lib/{canary → schemas}/products-edit.json +2 -2
- package/lib/{canary → schemas}/products.json +3 -3
- package/lib/{v3 → schemas}/snippets-add.json +2 -2
- package/lib/{v3 → schemas}/snippets-edit.json +2 -2
- package/lib/{v3 → schemas}/snippets.json +1 -1
- package/lib/{v3 → schemas}/tags-add.json +2 -2
- package/lib/{v2 → schemas}/tags-edit.json +2 -2
- package/lib/{v3 → schemas}/tags.json +1 -1
- package/lib/{canary → schemas}/tiers-add.json +2 -2
- package/lib/{canary → schemas}/tiers-edit.json +2 -2
- package/lib/{canary → schemas}/tiers.json +1 -1
- package/lib/{v3 → schemas}/webhooks-add.json +2 -2
- package/lib/{v3 → schemas}/webhooks-edit.json +1 -1
- package/lib/{v3 → schemas}/webhooks.json +1 -1
- package/package.json +2 -2
- package/lib/canary/images-upload.json +0 -7
- package/lib/canary/images.json +0 -23
- package/lib/canary/labels-add.json +0 -22
- package/lib/canary/labels-edit.json +0 -17
- package/lib/canary/labels.json +0 -39
- package/lib/canary/members-add.json +0 -21
- package/lib/canary/pages-add.json +0 -21
- package/lib/canary/pages-edit.json +0 -21
- package/lib/canary/posts-add.json +0 -21
- package/lib/canary/posts-edit.json +0 -21
- package/lib/canary/snippets-add.json +0 -22
- package/lib/canary/snippets-edit.json +0 -22
- package/lib/canary/snippets.json +0 -39
- package/lib/canary/tags-add.json +0 -22
- package/lib/canary/tags-edit.json +0 -17
- package/lib/canary/tags.json +0 -112
- package/lib/canary/webhooks-add.json +0 -21
- package/lib/canary/webhooks-edit.json +0 -74
- package/lib/canary/webhooks.json +0 -67
- package/lib/v2/README.md +0 -8
- package/lib/v2/images-upload.json +0 -7
- package/lib/v2/index.js +0 -9
- package/lib/v2/pages-add.json +0 -21
- package/lib/v2/pages-edit.json +0 -21
- package/lib/v2/pages.json +0 -250
- package/lib/v2/posts-add.json +0 -21
- package/lib/v2/posts-edit.json +0 -21
- package/lib/v2/posts.json +0 -250
- package/lib/v2/tags-add.json +0 -22
- package/lib/v2/tags.json +0 -69
- package/lib/v3/README.md +0 -8
- package/lib/v3/images.json +0 -23
- package/lib/v3/index.js +0 -18
- package/lib/v3/members-edit.json +0 -74
- package/lib/v3/members-upload.json +0 -48
- package/lib/v3/members.json +0 -109
- package/lib/v3/pages.json +0 -250
- package/lib/v3/posts.json +0 -263
- 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
|
|
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
|
|
package/lib/admin-api-schema.js
CHANGED
|
@@ -3,13 +3,12 @@ const jsonSchema = require('./utils/json-schema');
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
|
-
* @param {
|
|
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 = (
|
|
12
|
-
const definitionPath =
|
|
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
|
-
*
|
|
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 = (
|
|
48
|
-
|
|
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,
|
|
75
|
-
const schemaJSON =
|
|
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(
|
|
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:
|
|
144
|
-
list:
|
|
145
|
-
validate:
|
|
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/
|
|
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
|
|
3
|
+
"$id": "images.upload",
|
|
4
4
|
"title": "images.upload",
|
|
5
5
|
"description": "Schema for images.upload",
|
|
6
|
-
"$ref": "images
|
|
6
|
+
"$ref": "images#/definitions/image"
|
|
7
7
|
}
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "labels.add
|
|
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
|
|
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
|
|
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
|
|
13
|
+
"items": { "$ref": "labels#/definitions/label" }
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"required": ["labels"]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "media.upload
|
|
3
|
+
"$id": "media.upload",
|
|
4
4
|
"title": "media.upload",
|
|
5
5
|
"description": "Schema for media.upload",
|
|
6
|
-
"$ref": "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": "members.add
|
|
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
|
|
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
|
|
3
|
+
"$id": "members.edit",
|
|
4
4
|
"title": "members.edit",
|
|
5
5
|
"description": "Schema for members.edit",
|
|
6
6
|
"type": "object",
|
|
@@ -46,16 +46,16 @@
|
|
|
46
46
|
"strip": true
|
|
47
47
|
},
|
|
48
48
|
"products": {
|
|
49
|
-
"$ref": "members
|
|
49
|
+
"$ref": "members#/definitions/member-products"
|
|
50
50
|
},
|
|
51
51
|
"tiers": {
|
|
52
|
-
"$ref": "members
|
|
52
|
+
"$ref": "members#/definitions/member-products"
|
|
53
53
|
},
|
|
54
54
|
"newsletters": {
|
|
55
|
-
"$ref": "members
|
|
55
|
+
"$ref": "members#/definitions/member-newsletters"
|
|
56
56
|
},
|
|
57
57
|
"labels": {
|
|
58
|
-
"$ref": "members
|
|
58
|
+
"$ref": "members#/definitions/member-labels"
|
|
59
59
|
},
|
|
60
60
|
"email_count": {
|
|
61
61
|
"strip": true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "pages.add
|
|
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
|
|
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
|
|
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
|
|
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": "posts.add
|
|
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
|
|
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
|
|
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
|
|
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": "products.add
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
36
|
+
"type": "producs#/definitions/stripe_price"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"benefits": {
|
|
40
40
|
"type": ["array", "null"],
|
|
41
41
|
"items": {
|
|
42
|
-
"type": "producs
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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": "tags.add
|
|
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
|
|
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
|
|
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
|
|
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": "tiers.add
|
|
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
|
|
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
|
|
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
|
|
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": "webhooks.add
|
|
3
|
+
"$id": "webhooks.add",
|
|
4
4
|
"title": "webhooks.add",
|
|
5
5
|
"description": "Schema for webhooks.add",
|
|
6
6
|
"type": "object",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"maxItems": 1,
|
|
13
13
|
"items": {
|
|
14
14
|
"type": "object",
|
|
15
|
-
"allOf": [{ "$ref": "webhooks
|
|
15
|
+
"allOf": [{ "$ref": "webhooks#/definitions/webhook" }],
|
|
16
16
|
"required": ["event", "target_url"]
|
|
17
17
|
}
|
|
18
18
|
}
|