Skip to content

Commit 1455fa6

Browse files
committed
Consolidate common embed schema into individual schemas
1 parent a9c17f4 commit 1455fa6

14 files changed

+81
-100
lines changed

js/EmbedContentRequest.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ export const SCHEMA = {
1010
"description": "Schema for embed content requests received by RayServe",
1111
"additionalProperties": false,
1212
"definitions": {
13+
"uuid": {
14+
"type": "string",
15+
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
16+
"description": "A unique identifier in the form of a UUID"
17+
},
1318
"language": {
1419
"type": "string",
1520
"description": "Language code from https://github.com/learningequality/le-utils/blob/main/le_utils/resources/languagelookup.json",
@@ -81,11 +86,11 @@ export const SCHEMA = {
8186
"additionalProperties": false,
8287
"properties": {
8388
"id": {
84-
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
89+
"$ref": "#/definitions/uuid",
8590
"description": "The UUID of the content resource"
8691
},
8792
"channel_id": {
88-
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
93+
"$ref": "#/definitions/uuid",
8994
"description": "The UUID of the channel that the content resource belongs to"
9095
},
9196
"title": {
@@ -111,7 +116,7 @@ export const SCHEMA = {
111116
}
112117
},
113118
"content_id": {
114-
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
119+
"$ref": "#/definitions/uuid",
115120
"description": "The UUID of the content resource(s)"
116121
}
117122
},

js/EmbedTopicsRequest.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ export const SCHEMA = {
1010
"description": "Schema for embed topics requests received by RayServe",
1111
"additionalProperties": false,
1212
"definitions": {
13+
"uuid": {
14+
"type": "string",
15+
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
16+
"description": "A unique identifier in the form of a UUID"
17+
},
1318
"title": {
1419
"type": "string",
1520
"description": "The title of the topic"
@@ -33,7 +38,7 @@ export const SCHEMA = {
3338
"additionalProperties": false,
3439
"properties": {
3540
"id": {
36-
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
41+
"$ref": "#/definitions/uuid",
3742
"description": "The ID of the topic content node on Studio"
3843
},
3944
"title": {
@@ -69,11 +74,11 @@ export const SCHEMA = {
6974
"additionalProperties": false,
7075
"properties": {
7176
"id": {
72-
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
77+
"$ref": "#/definitions/uuid",
7378
"description": "The ID of the topic content node on Studio"
7479
},
7580
"channel_id": {
76-
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
81+
"$ref": "#/definitions/uuid",
7782
"description": "The UUID of the channel that the topic belongs to"
7883
},
7984
"title": {

js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@
2727
"scripts": {
2828
"test": "echo \"Error: no test specified\" && exit 1"
2929
},
30-
"version": "0.2.11"
30+
"version": "0.2.12"
3131
}

le_utils/constants/embed_content_request.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
"description": "Schema for embed content requests received by RayServe",
1717
"additionalProperties": False,
1818
"definitions": {
19+
"uuid": {
20+
"type": "string",
21+
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
22+
"description": "A unique identifier in the form of a UUID",
23+
},
1924
"language": {
2025
"type": "string",
2126
"description": "Language code from https://github.com/learningequality/le-utils/blob/main/le_utils/resources/languagelookup.json",
@@ -78,11 +83,11 @@
7883
"additionalProperties": False,
7984
"properties": {
8085
"id": {
81-
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
86+
"$ref": "#/definitions/uuid",
8287
"description": "The UUID of the content resource",
8388
},
8489
"channel_id": {
85-
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
90+
"$ref": "#/definitions/uuid",
8691
"description": "The UUID of the channel that the content resource belongs to",
8792
},
8893
"title": {
@@ -104,7 +109,7 @@
104109
"items": {"$ref": "#/definitions/file"},
105110
},
106111
"content_id": {
107-
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
112+
"$ref": "#/definitions/uuid",
108113
"description": "The UUID of the content resource(s)",
109114
},
110115
},

le_utils/constants/embed_topics_request.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
"description": "Schema for embed topics requests received by RayServe",
1717
"additionalProperties": False,
1818
"definitions": {
19+
"uuid": {
20+
"type": "string",
21+
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
22+
"description": "A unique identifier in the form of a UUID",
23+
},
1924
"title": {"type": "string", "description": "The title of the topic"},
2025
"description": {
2126
"type": "string",
@@ -36,7 +41,7 @@
3641
"additionalProperties": False,
3742
"properties": {
3843
"id": {
39-
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
44+
"$ref": "#/definitions/uuid",
4045
"description": "The ID of the topic content node on Studio",
4146
},
4247
"title": {"$ref": "#/definitions/title"},
@@ -57,11 +62,11 @@
5762
"additionalProperties": False,
5863
"properties": {
5964
"id": {
60-
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
65+
"$ref": "#/definitions/uuid",
6166
"description": "The ID of the topic content node on Studio",
6267
},
6368
"channel_id": {
64-
"$ref": "/schemas/common_embed_definitions#/definitions/uuid",
69+
"$ref": "#/definitions/uuid",
6570
"description": "The UUID of the channel that the topic belongs to",
6671
},
6772
"title": {"$ref": "#/definitions/title"},

le_utils/resources/definitions-embed_common.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

le_utils/validators/__init__.py

Whitespace-only changes.

le_utils/validators/common.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

le_utils/validators/embed_content_request.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

le_utils/validators/embed_topics_request.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)