From dde9c9c1e6e7be364ed32ec6a7408848692e8bd3 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 20 Aug 2024 18:21:38 +0100 Subject: [PATCH 1/9] Update some packages. --- package.json | 10 +++++----- packages/wp-types/package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 3c4c914..aba11a9 100644 --- a/package.json +++ b/package.json @@ -20,15 +20,15 @@ "license": "MIT", "devDependencies": { "ajv-cli": "^5.0", - "ajv-formats": "^2.0", - "json-schema-to-typescript": "^12.0", - "node-jq": "^2.3.5", - "typescript": ">=3" + "ajv-formats": "^3.0", + "json-schema-to-typescript": "^15.0", + "node-jq": "^6.0", + "typescript": ">=5" }, "scripts": { "version": "cd packages/wp-types && npm version $(node -p -e \"require('../../package.json').version\") && git add .", "build-wp-types": "json2ts -i schema.json -o packages/wp-types/index.ts --style.trailingComma=all --style.useTabs && cat packages/wp-types/append.ts >> packages/wp-types/index.ts", - "test-wp-types": "tsc packages/wp-types/tests/test.ts --noEmit --strict", + "test-wp-types": "tsc packages/wp-types/tests/test.ts --noEmit --strict --target es2015", "validate": "ajv compile --strict --strict-schema=false -c ajv-formats -m tests/external-schemas/hyper-schema.json -s schema.json -r \"schemas/**/*.json\"" } } diff --git a/packages/wp-types/package.json b/packages/wp-types/package.json index 23b08c1..f8cfb88 100644 --- a/packages/wp-types/package.json +++ b/packages/wp-types/package.json @@ -16,6 +16,6 @@ "author": "John Blackbourn", "license": "MIT", "dependencies": { - "typescript": ">=3" + "typescript": ">=5" } } From f960f9c5388c1097a958dd01c9aec1bcda8db229 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 20 Aug 2024 18:22:03 +0100 Subject: [PATCH 2/9] This isn't needed. --- packages/wp-types/tsconfig.json | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 packages/wp-types/tsconfig.json diff --git a/packages/wp-types/tsconfig.json b/packages/wp-types/tsconfig.json deleted file mode 100644 index 9c02dc6..0000000 --- a/packages/wp-types/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "strict": true - }, - "include": [ - "index.ts" - ] -} From be9197eda2dfc600cd79770c997ad54be75543dd Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 20 Aug 2024 18:31:44 +0100 Subject: [PATCH 3/9] Begin splitting some schemas into partials. --- package.json | 2 +- packages/wp-types/index.ts | 162 +++++---- schemas/rest-api/attachment.json | 2 +- schemas/rest-api/comment.json | 2 +- schemas/rest-api/page.json | 22 +- schemas/rest-api/partials/post/author.json | 36 ++ schemas/rest-api/partials/post/comments.json | 29 ++ schemas/rest-api/partials/post/common.json | 237 +++++++++++++ schemas/rest-api/partials/post/excerpt.json | 39 +++ schemas/rest-api/partials/post/public.json | 30 ++ schemas/rest-api/post.json | 334 +------------------ 11 files changed, 508 insertions(+), 387 deletions(-) create mode 100644 schemas/rest-api/partials/post/author.json create mode 100644 schemas/rest-api/partials/post/comments.json create mode 100644 schemas/rest-api/partials/post/common.json create mode 100644 schemas/rest-api/partials/post/excerpt.json create mode 100644 schemas/rest-api/partials/post/public.json diff --git a/package.json b/package.json index aba11a9..3ddcfca 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "scripts": { "version": "cd packages/wp-types && npm version $(node -p -e \"require('../../package.json').version\") && git add .", - "build-wp-types": "json2ts -i schema.json -o packages/wp-types/index.ts --style.trailingComma=all --style.useTabs && cat packages/wp-types/append.ts >> packages/wp-types/index.ts", + "build-wp-types": "json2ts -i schema.json -o packages/wp-types/index.ts --style.trailingComma=all --style.useTabs && cat packages/wp-types/append.ts >> packages/wp-types/index.ts && sed -i '' 's/export interface WP_REST_API_Partial_/interface WP_REST_API_Partial_/g' packages/wp-types/index.ts", "test-wp-types": "tsc packages/wp-types/tests/test.ts --noEmit --strict --target es2015", "validate": "ajv compile --strict --strict-schema=false -c ajv-formats -m tests/external-schemas/hyper-schema.json -s schema.json -r \"schemas/**/*.json\"" } diff --git a/packages/wp-types/index.ts b/packages/wp-types/index.ts index 3d552ee..79a7427 100644 --- a/packages/wp-types/index.ts +++ b/packages/wp-types/index.ts @@ -48,6 +48,42 @@ export type WP_REST_API_Font_Families = WP_REST_API_Font_Family[]; * A collection of font face objects in a REST API context. */ export type WP_REST_API_Font_Faces = WP_REST_API_Font_Face[]; +/** + * A post object in a REST API context. + */ +export type WP_REST_API_Post = WP_REST_API_Partial_Post_Common & + WP_REST_API_Partial_Post_Author & + WP_REST_API_Partial_Post_Public & + WP_REST_API_Partial_Post_Comments & + WP_REST_API_Partial_Post_Excerpt & { + /** + * The embedded representation of relations. Only present when the '_embed' query parameter is set. + */ + _embedded?: { + /** + * The author of the post. + */ + author: unknown[]; + /** + * The replies to the post (comments, pingbacks, trackbacks). + */ + replies?: unknown[]; + /** + * The taxonomy terms for the post. + */ + "wp:term"?: unknown[]; + /** + * The featured image post. + */ + "wp:featuredmedia"?: unknown[]; + /** + * The parent post. + */ + up?: unknown[]; + [k: string]: unknown; + }; + [k: string]: unknown; + }; /** * A collection of post objects in a REST API context. */ @@ -55,7 +91,11 @@ export type WP_REST_API_Posts = WP_REST_API_Post[]; /** * A page object in a REST API context. */ -export type WP_REST_API_Page = WP_REST_API_Post; +export type WP_REST_API_Page = WP_REST_API_Partial_Post_Common & + WP_REST_API_Partial_Post_Author & + WP_REST_API_Partial_Post_Public & + WP_REST_API_Partial_Post_Comments & + WP_REST_API_Partial_Post_Excerpt; /** * A collection of page objects in a REST API context. */ @@ -2106,9 +2146,9 @@ export interface WP_REST_API_Font_Face { [k: string]: unknown; } /** - * A post object in a REST API context. + * Common post properties */ -export interface WP_REST_API_Post { +interface WP_REST_API_Partial_Post_Common { /** * The date the post was published, in the site's timezone. */ @@ -2162,14 +2202,6 @@ export interface WP_REST_API_Post { * A password to protect access to the content and excerpt. Only present when using the 'edit' context. */ password?: string; - /** - * Permalink template for the post. Only present when using the 'edit' context and the post type is public. - */ - permalink_template?: string; - /** - * Slug automatically generated from the post title. Only present when using the 'edit' context and the post type is public. - */ - generated_slug?: string; /** * The ID for the parent of the post. Only present for hierarchical post types. */ @@ -2178,10 +2210,6 @@ export interface WP_REST_API_Post { * A field used for ordering posts. */ menu_order?: number; - /** - * An array of the class names for the post container element. - */ - class_list: string[]; /** * The title for the post. */ @@ -2216,39 +2244,10 @@ export interface WP_REST_API_Post { */ protected: boolean; }; - /** - * The ID for the author of the post. - */ - author: number; - /** - * The excerpt for the post. - */ - excerpt: { - /** - * Excerpt for the post, as it exists in the database. Only present when using the 'edit' context. - */ - raw?: string; - /** - * HTML excerpt for the post, transformed for display. - */ - rendered: string; - /** - * Whether the excerpt is protected with a password. - */ - protected: boolean; - }; /** * The ID of the featured media for the post. */ featured_media?: number; - /** - * Whether or not comments are open on the post. - */ - comment_status: WP_Post_Comment_Status_Name; - /** - * Whether or not the post can be pinged. - */ - ping_status: WP_Post_Comment_Status_Name; /** * The format for the post. */ @@ -2256,7 +2255,7 @@ export interface WP_REST_API_Post { /** * Meta fields. */ - meta: + meta?: | EmptyArray | { [k: string]: unknown; @@ -2278,31 +2277,70 @@ export interface WP_REST_API_Post { */ tags?: number[]; _links: WP_REST_API_Object_Links; + [k: string]: unknown; +} +/** + * Hello. + */ +interface WP_REST_API_Partial_Post_Author { /** - * The embedded representation of relations. Only present when the '_embed' query parameter is set. + * The ID for the author of the post. */ - _embedded?: { - /** - * The author of the post. - */ - author: unknown[]; - /** - * The replies to the post (comments, pingbacks, trackbacks). - */ - replies?: unknown[]; + author: number; + [k: string]: unknown; +} +/** + * Properties for public post types + */ +interface WP_REST_API_Partial_Post_Public { + /** + * Permalink template for the post. Only present when using the 'edit' context and the post type is public. + */ + permalink_template?: string; + /** + * Slug automatically generated from the post title. Only present when using the 'edit' context and the post type is public. + */ + generated_slug?: string; + /** + * An array of the class names for the post container element. + */ + class_list: string[]; + [k: string]: unknown; +} +/** + * Properties for post types that support comments + */ +interface WP_REST_API_Partial_Post_Comments { + /** + * Whether or not comments are open on the post. + */ + comment_status: WP_Post_Comment_Status_Name; + /** + * Whether or not the post can be pinged. + */ + ping_status: WP_Post_Comment_Status_Name; + [k: string]: unknown; +} +/** + * Properties for post types that support an excerpt + */ +interface WP_REST_API_Partial_Post_Excerpt { + /** + * The excerpt for the post. + */ + excerpt: { /** - * The taxonomy terms for the post. + * Excerpt for the post, as it exists in the database. Only present when using the 'edit' context. */ - "wp:term"?: unknown[]; + raw?: string; /** - * The featured image post. + * HTML excerpt for the post, transformed for display. */ - "wp:featuredmedia"?: unknown[]; + rendered: string; /** - * The parent post. + * Whether the excerpt is protected with a password. */ - up?: unknown[]; - [k: string]: unknown; + protected: boolean; }; [k: string]: unknown; } diff --git a/schemas/rest-api/attachment.json b/schemas/rest-api/attachment.json index 1a1f3ff..6659acf 100644 --- a/schemas/rest-api/attachment.json +++ b/schemas/rest-api/attachment.json @@ -194,7 +194,7 @@ { "allOf": [ { - "$ref": "post.json#/properties/id" + "$ref": "partials/post/common.json#/properties/id" } ] }, diff --git a/schemas/rest-api/comment.json b/schemas/rest-api/comment.json index a517824..fca9557 100644 --- a/schemas/rest-api/comment.json +++ b/schemas/rest-api/comment.json @@ -143,7 +143,7 @@ "description": "The ID of the associated post object.", "allOf": [ { - "$ref": "post.json#/properties/id" + "$ref": "partials/post/common.json#/properties/id" } ] }, diff --git a/schemas/rest-api/page.json b/schemas/rest-api/page.json index b38059e..8c716dc 100644 --- a/schemas/rest-api/page.json +++ b/schemas/rest-api/page.json @@ -6,7 +6,19 @@ "type": "object", "allOf": [ { - "$ref": "post.json" + "$ref": "partials/post/common.json" + }, + { + "$ref": "./partials/post/author.json" + }, + { + "$ref": "./partials/post/public.json" + }, + { + "$ref": "./partials/post/comments.json" + }, + { + "$ref": "./partials/post/excerpt.json" } ], "links": [ @@ -16,7 +28,7 @@ "hrefSchema": { "properties": { "id": { - "$ref": "post.json#/properties/id" + "$ref": "partials/post/common.json#/properties/id" } } }, @@ -40,7 +52,7 @@ "hrefSchema": { "properties": { "author": { - "$ref": "post.json#/properties/author" + "$ref": "partials/post/author.json#/properties/author" } } }, @@ -54,7 +66,7 @@ "hrefSchema": { "properties": { "id": { - "$ref": "post.json#/properties/id" + "$ref": "partials/post/common.json#/properties/id" } } }, @@ -71,7 +83,7 @@ "hrefSchema": { "properties": { "id": { - "$ref": "post.json#/properties/id" + "$ref": "partials/post/common.json#/properties/id" } } }, diff --git a/schemas/rest-api/partials/post/author.json b/schemas/rest-api/partials/post/author.json new file mode 100644 index 0000000..4416108 --- /dev/null +++ b/schemas/rest-api/partials/post/author.json @@ -0,0 +1,36 @@ +{ + "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/partials/post/author.json", + "title": "WP_REST_API_Partial_Post_Author", + "description": "Hello.", + "type": "object", + "required": [ + "author" + ], + "properties": { + "author": { + "description": "The ID for the author of the post.", + "allOf": [ + { + "$ref": "../../user.json#/properties/id" + } + ] + } + }, + "links": [ + { + "rel": "author", + "href": "/wp/v2/users/{author}", + "hrefSchema": { + "properties": { + "author": { + "$ref": "#/properties/author" + } + } + }, + "targetSchema": { + "$ref": "../../user.json" + } + } + ] +} diff --git a/schemas/rest-api/partials/post/comments.json b/schemas/rest-api/partials/post/comments.json new file mode 100644 index 0000000..63f65ff --- /dev/null +++ b/schemas/rest-api/partials/post/comments.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/partials/post/comments.json", + "title": "WP_REST_API_Partial_Post_Comments", + "description": "Properties for post types that support comments", + "type": "object", + "required": [ + "comment_status", + "ping_status" + ], + "properties": { + "comment_status": { + "description": "Whether or not comments are open on the post.", + "oneOf": [ + { + "$ref": "../../../properties/post-comment-status-name.json" + } + ] + }, + "ping_status": { + "description": "Whether or not the post can be pinged.", + "oneOf": [ + { + "$ref": "../../../properties/post-comment-status-name.json" + } + ] + } + } +} diff --git a/schemas/rest-api/partials/post/common.json b/schemas/rest-api/partials/post/common.json new file mode 100644 index 0000000..68ec375 --- /dev/null +++ b/schemas/rest-api/partials/post/common.json @@ -0,0 +1,237 @@ +{ + "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/partials/post/common.json", + "title": "WP_REST_API_Partial_Post_Common", + "description": "Common post properties", + "type": "object", + "required": [ + "date", + "date_gmt", + "guid", + "id", + "link", + "modified", + "modified_gmt", + "slug", + "status", + "type", + "title", + "content", + "_links" + ], + "properties": { + "date": { + "description": "The date the post was published, in the site's timezone.", + "oneOf": [ + { + "$ref": "../../properties/date-time.json" + } + ] + }, + "date_gmt": { + "description": "The date the post was published, as GMT.", + "oneOf": [ + { + "$ref": "../../properties/date-time.json" + } + ] + }, + "guid": { + "readOnly": true, + "description": "The globally unique identifier for the post.", + "type": "object", + "required": [ + "rendered" + ], + "properties": { + "raw": { + "readOnly": true, + "description": "GUID for the post, as it exists in the database. Only present when using the 'edit' context.", + "type": "string" + }, + "rendered": { + "readOnly": true, + "description": "GUID for the post, transformed for display.", + "type": "string" + } + }, + "additionalProperties": false + }, + "id": { + "readOnly": true, + "description": "Unique identifier for the post.", + "type": "integer" + }, + "link": { + "readOnly": true, + "description": "URL to the post.", + "type": "string", + "format": "uri" + }, + "modified": { + "readOnly": true, + "description": "The date the post was last modified, in the site's timezone.", + "oneOf": [ + { + "$ref": "../../properties/date-time.json" + } + ] + }, + "modified_gmt": { + "readOnly": true, + "description": "The date the post was last modified, as GMT.", + "oneOf": [ + { + "$ref": "../../properties/date-time.json" + } + ] + }, + "slug": { + "description": "An alphanumeric identifier for the post unique to its type.", + "type": "string" + }, + "status": { + "description": "A named status for the post.", + "anyOf": [ + { + "$ref": "../../../properties/post-status-name.json" + }, + { + "type": "string" + } + ] + }, + "type": { + "readOnly": true, + "description": "Type of Post for the post.", + "anyOf": [ + { + "$ref": "../../../properties/post-type-name.json" + }, + { + "type": "string" + } + ] + }, + "password": { + "description": "A password to protect access to the content and excerpt. Only present when using the 'edit' context.", + "type": "string" + }, + "parent": { + "description": "The ID for the parent of the post. Only present for hierarchical post types.", + "allOf": [ + { + "$ref": "#/properties/id" + } + ] + }, + "menu_order": { + "description": "A field used for ordering posts.", + "type": "integer" + }, + "title": { + "description": "The title for the post.", + "type": "object", + "required": [ + "rendered" + ], + "properties": { + "raw": { + "description": "Title for the post, as it exists in the database. Only present when using the 'edit' context.", + "type": "string" + }, + "rendered": { + "readOnly": true, + "contentMediaType": "text/html", + "description": "HTML title for the post, transformed for display.", + "type": "string" + } + }, + "additionalProperties": false + }, + "content": { + "description": "The content for the post.", + "type": "object", + "required": [ + "rendered", + "protected" + ], + "properties": { + "raw": { + "description": "Content for the post, as it exists in the database. Only present when using the 'edit' context.", + "contentMediaType": "text/html", + "type": "string" + }, + "rendered": { + "readOnly": true, + "description": "HTML content for the post, transformed for display.", + "contentMediaType": "text/html", + "type": "string" + }, + "block_version": { + "readOnly": true, + "description": "Version of the content block format used by the post. Only present when using the 'edit' context.", + "type": "integer" + }, + "protected": { + "readOnly": true, + "description": "Whether the content is protected with a password.", + "type": "boolean" + } + }, + "additionalProperties": false + }, + "featured_media": { + "description": "The ID of the featured media for the post.", + "allOf": [ + { + "$ref": "#/properties/id" + } + ] + }, + "format": { + "description": "The format for the post.", + "oneOf": [ + { + "$ref": "../../../properties/post-format-name.json" + } + ] + }, + "meta": { + "description": "Meta fields.", + "oneOf": [ + { + "$ref": "../../../../schema.json#/definitions/EmptyArray" + }, + { + "type": "object" + } + ] + }, + "sticky": { + "description": "Whether or not the post should be treated as sticky. Only present for the 'post' post type.", + "type": "boolean" + }, + "template": { + "description": "The theme file to use to display the post.", + "type": "string" + }, + "categories": { + "description": "The terms assigned to the post in the category taxonomy. Only present for post types that support categories.", + "type": "array", + "items": { + "$ref": "../../term.json#/properties/id" + } + }, + "tags": { + "description": "The terms assigned to the post in the post_tag taxonomy. Only present for post types that support tags.", + "type": "array", + "items": { + "$ref": "../../term.json#/properties/id" + } + }, + "_links": { + "$ref": "../../properties/object-links.json" + } + } +} diff --git a/schemas/rest-api/partials/post/excerpt.json b/schemas/rest-api/partials/post/excerpt.json new file mode 100644 index 0000000..65738b9 --- /dev/null +++ b/schemas/rest-api/partials/post/excerpt.json @@ -0,0 +1,39 @@ +{ + "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/partials/post/excerpt.json", + "title": "WP_REST_API_Partial_Post_Excerpt", + "description": "Properties for post types that support an excerpt", + "type": "object", + "required": [ + "excerpt" + ], + "properties": { + "excerpt": { + "description": "The excerpt for the post.", + "type": "object", + "required": [ + "rendered", + "protected" + ], + "properties": { + "raw": { + "description": "Excerpt for the post, as it exists in the database. Only present when using the 'edit' context.", + "contentMediaType": "text/html", + "type": "string" + }, + "rendered": { + "readOnly": true, + "description": "HTML excerpt for the post, transformed for display.", + "contentMediaType": "text/html", + "type": "string" + }, + "protected": { + "readOnly": true, + "description": "Whether the excerpt is protected with a password.", + "type": "boolean" + } + }, + "additionalProperties": false + } + } +} diff --git a/schemas/rest-api/partials/post/public.json b/schemas/rest-api/partials/post/public.json new file mode 100644 index 0000000..de69ba5 --- /dev/null +++ b/schemas/rest-api/partials/post/public.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/partials/post/public.json", + "title": "WP_REST_API_Partial_Post_Public", + "description": "Properties for public post types", + "type": "object", + "required": [ + "class_list" + ], + "properties": { + "permalink_template": { + "readOnly": true, + "description": "Permalink template for the post. Only present when using the 'edit' context and the post type is public.", + "type": "string" + }, + "generated_slug": { + "readOnly": true, + "description": "Slug automatically generated from the post title. Only present when using the 'edit' context and the post type is public.", + "type": "string" + }, + "class_list": { + "readOnly": true, + "description": "An array of the class names for the post container element.", + "type": "array", + "items": { + "type": "string" + } + } + } +} diff --git a/schemas/rest-api/post.json b/schemas/rest-api/post.json index d79fdbd..00d97f1 100644 --- a/schemas/rest-api/post.json +++ b/schemas/rest-api/post.json @@ -4,310 +4,24 @@ "title": "WP_REST_API_Post", "description": "A post object in a REST API context.", "type": "object", - "required": [ - "date", - "date_gmt", - "guid", - "id", - "link", - "modified", - "modified_gmt", - "slug", - "status", - "type", - "class_list", - "title", - "content", - "author", - "excerpt", - "comment_status", - "ping_status", - "meta", - "_links" - ], - "properties": { - "date": { - "description": "The date the post was published, in the site's timezone.", - "oneOf": [ - { - "$ref": "properties/date-time.json" - } - ] - }, - "date_gmt": { - "description": "The date the post was published, as GMT.", - "oneOf": [ - { - "$ref": "properties/date-time.json" - } - ] - }, - "guid": { - "readOnly": true, - "description": "The globally unique identifier for the post.", - "type": "object", - "required": [ - "rendered" - ], - "properties": { - "raw": { - "readOnly": true, - "description": "GUID for the post, as it exists in the database. Only present when using the 'edit' context.", - "type": "string" - }, - "rendered": { - "readOnly": true, - "description": "GUID for the post, transformed for display.", - "type": "string" - } - }, - "additionalProperties": false - }, - "id": { - "readOnly": true, - "description": "Unique identifier for the post.", - "type": "integer" - }, - "link": { - "readOnly": true, - "description": "URL to the post.", - "type": "string", - "format": "uri" - }, - "modified": { - "readOnly": true, - "description": "The date the post was last modified, in the site's timezone.", - "oneOf": [ - { - "$ref": "properties/date-time.json" - } - ] - }, - "modified_gmt": { - "readOnly": true, - "description": "The date the post was last modified, as GMT.", - "oneOf": [ - { - "$ref": "properties/date-time.json" - } - ] - }, - "slug": { - "description": "An alphanumeric identifier for the post unique to its type.", - "type": "string" - }, - "status": { - "description": "A named status for the post.", - "anyOf": [ - { - "$ref": "../properties/post-status-name.json" - }, - { - "type": "string" - } - ] - }, - "type": { - "readOnly": true, - "description": "Type of Post for the post.", - "anyOf": [ - { - "$ref": "../properties/post-type-name.json" - }, - { - "type": "string" - } - ] - }, - "password": { - "description": "A password to protect access to the content and excerpt. Only present when using the 'edit' context.", - "type": "string" - }, - "permalink_template": { - "readOnly": true, - "description": "Permalink template for the post. Only present when using the 'edit' context and the post type is public.", - "type": "string" - }, - "generated_slug": { - "readOnly": true, - "description": "Slug automatically generated from the post title. Only present when using the 'edit' context and the post type is public.", - "type": "string" - }, - "parent": { - "description": "The ID for the parent of the post. Only present for hierarchical post types.", - "allOf": [ - { - "$ref": "#/properties/id" - } - ] - }, - "menu_order": { - "description": "A field used for ordering posts.", - "type": "integer" - }, - "class_list": { - "readOnly": true, - "description": "An array of the class names for the post container element.", - "type": "array", - "items": { - "type": "string" - } - }, - "title": { - "description": "The title for the post.", - "type": "object", - "required": [ - "rendered" - ], - "properties": { - "raw": { - "description": "Title for the post, as it exists in the database. Only present when using the 'edit' context.", - "type": "string" - }, - "rendered": { - "readOnly": true, - "contentMediaType": "text/html", - "description": "HTML title for the post, transformed for display.", - "type": "string" - } - }, - "additionalProperties": false - }, - "content": { - "description": "The content for the post.", - "type": "object", - "required": [ - "rendered", - "protected" - ], - "properties": { - "raw": { - "description": "Content for the post, as it exists in the database. Only present when using the 'edit' context.", - "contentMediaType": "text/html", - "type": "string" - }, - "rendered": { - "readOnly": true, - "description": "HTML content for the post, transformed for display.", - "contentMediaType": "text/html", - "type": "string" - }, - "block_version": { - "readOnly": true, - "description": "Version of the content block format used by the post. Only present when using the 'edit' context.", - "type": "integer" - }, - "protected": { - "readOnly": true, - "description": "Whether the content is protected with a password.", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "author": { - "description": "The ID for the author of the post.", - "allOf": [ - { - "$ref": "user.json#/properties/id" - } - ] - }, - "excerpt": { - "description": "The excerpt for the post.", - "type": "object", - "required": [ - "rendered", - "protected" - ], - "properties": { - "raw": { - "description": "Excerpt for the post, as it exists in the database. Only present when using the 'edit' context.", - "contentMediaType": "text/html", - "type": "string" - }, - "rendered": { - "readOnly": true, - "description": "HTML excerpt for the post, transformed for display.", - "contentMediaType": "text/html", - "type": "string" - }, - "protected": { - "readOnly": true, - "description": "Whether the excerpt is protected with a password.", - "type": "boolean" - } - }, - "additionalProperties": false - }, - "featured_media": { - "description": "The ID of the featured media for the post.", - "allOf": [ - { - "$ref": "#/properties/id" - } - ] - }, - "comment_status": { - "description": "Whether or not comments are open on the post.", - "oneOf": [ - { - "$ref": "../properties/post-comment-status-name.json" - } - ] - }, - "ping_status": { - "description": "Whether or not the post can be pinged.", - "oneOf": [ - { - "$ref": "../properties/post-comment-status-name.json" - } - ] - }, - "format": { - "description": "The format for the post.", - "oneOf": [ - { - "$ref": "../properties/post-format-name.json" - } - ] - }, - "meta": { - "description": "Meta fields.", - "oneOf": [ - { - "$ref": "../../schema.json#/definitions/EmptyArray" - }, - { - "type": "object" - } - ] - }, - "sticky": { - "description": "Whether or not the post should be treated as sticky. Only present for the 'post' post type.", - "type": "boolean" - }, - "template": { - "description": "The theme file to use to display the post.", - "type": "string" + "allOf": [ + { + "$ref": "./partials/post/common.json" }, - "categories": { - "description": "The terms assigned to the post in the category taxonomy. Only present for post types that support categories.", - "type": "array", - "items": { - "$ref": "term.json#/properties/id" - } + { + "$ref": "./partials/post/author.json" }, - "tags": { - "description": "The terms assigned to the post in the post_tag taxonomy. Only present for post types that support tags.", - "type": "array", - "items": { - "$ref": "term.json#/properties/id" - } + { + "$ref": "./partials/post/public.json" }, - "_links": { - "$ref": "properties/object-links.json" + { + "$ref": "./partials/post/comments.json" }, + { + "$ref": "./partials/post/excerpt.json" + } + ], + "properties": { "_embedded": { "description": "The embedded representation of relations. Only present when the '_embed' query parameter is set.", "type": "object", @@ -345,7 +59,7 @@ "hrefSchema": { "properties": { "id": { - "$ref": "#/properties/id" + "$ref": "partials/post/common.json#/properties/id" } } }, @@ -363,27 +77,13 @@ } } }, - { - "rel": "author", - "href": "/wp/v2/users/{author}", - "hrefSchema": { - "properties": { - "author": { - "$ref": "#/properties/author" - } - } - }, - "targetSchema": { - "$ref": "user.json" - } - }, { "rel": "replies", "href": "/wp/v2/comments?post={id}", "hrefSchema": { "properties": { "id": { - "$ref": "#/properties/id" + "$ref": "partials/post/common.json#/properties/id" } } }, @@ -400,7 +100,7 @@ "hrefSchema": { "properties": { "id": { - "$ref": "#/properties/id" + "$ref": "partials/post/common.json#/properties/id" } } }, From 44d5694074458cdfaddcc1239e4f3be533231f6e Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 20 Aug 2024 18:32:11 +0100 Subject: [PATCH 4/9] Update Node. --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index b6a7d89..209e3ef 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16 +20 From f4b33ef7f63d519163bffc8321efa4cb815800a3 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 20 Aug 2024 22:00:55 +0100 Subject: [PATCH 5/9] Pages can be embedded too. --- packages/wp-types/index.ts | 30 +++++++++++++++++++++++++++++- schemas/rest-api/page.json | 31 +++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/packages/wp-types/index.ts b/packages/wp-types/index.ts index 79a7427..06cd17a 100644 --- a/packages/wp-types/index.ts +++ b/packages/wp-types/index.ts @@ -95,7 +95,35 @@ export type WP_REST_API_Page = WP_REST_API_Partial_Post_Common & WP_REST_API_Partial_Post_Author & WP_REST_API_Partial_Post_Public & WP_REST_API_Partial_Post_Comments & - WP_REST_API_Partial_Post_Excerpt; + WP_REST_API_Partial_Post_Excerpt & { + /** + * The embedded representation of relations. Only present when the '_embed' query parameter is set. + */ + _embedded?: { + /** + * The author of the page. + */ + author: unknown[]; + /** + * The replies to the page (comments, pingbacks, trackbacks). + */ + replies?: unknown[]; + /** + * The taxonomy terms for the page. + */ + "wp:term"?: unknown[]; + /** + * The featured image page. + */ + "wp:featuredmedia"?: unknown[]; + /** + * The parent page. + */ + up?: unknown[]; + [k: string]: unknown; + }; + [k: string]: unknown; + }; /** * A collection of page objects in a REST API context. */ diff --git a/schemas/rest-api/page.json b/schemas/rest-api/page.json index 8c716dc..c94e5ae 100644 --- a/schemas/rest-api/page.json +++ b/schemas/rest-api/page.json @@ -21,6 +21,37 @@ "$ref": "./partials/post/excerpt.json" } ], + "properties": { + "_embedded": { + "description": "The embedded representation of relations. Only present when the '_embed' query parameter is set.", + "type": "object", + "required": [ + "author" + ], + "properties": { + "author": { + "description": "The author of the page.", + "type": "array" + }, + "replies": { + "description": "The replies to the page (comments, pingbacks, trackbacks).", + "type": "array" + }, + "wp:term": { + "description": "The taxonomy terms for the page.", + "type": "array" + }, + "wp:featuredmedia": { + "description": "The featured image page.", + "type": "array" + }, + "up": { + "description": "The parent page.", + "type": "array" + } + } + } + }, "links": [ { "rel": "self", From 06439ef89240620df2dc6d2fdca2f83d9eb2a98d Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 20 Aug 2024 22:03:37 +0100 Subject: [PATCH 6/9] Update everything to the 2019-09 schema so we can test for unevaluated properties in the combined schemas. --- package.json | 2 +- schema.json | 2 +- schemas/block-template.json | 2 +- schemas/block-type.json | 2 +- schemas/block.json | 2 +- schemas/comment.json | 2 +- schemas/error-with-error.json | 2 +- schemas/error-without-error.json | 2 +- schemas/error.json | 2 +- schemas/locale.json | 2 +- schemas/network.json | 2 +- schemas/post-type.json | 2 +- schemas/post.json | 2 +- schemas/properties/block-parsed.json | 2 +- schemas/properties/callable.json | 2 +- schemas/properties/comment-status-name.json | 2 +- schemas/properties/comment-type-name.json | 2 +- schemas/properties/date-time.json | 2 +- schemas/properties/error-data.json | 2 +- schemas/properties/error-messages.json | 2 +- schemas/properties/object-filter-context.json | 2 +- .../properties/post-comment-status-name.json | 2 +- schemas/properties/post-format-name.json | 2 +- schemas/properties/post-status-name.json | 2 +- schemas/properties/post-type-caps.json | 2 +- schemas/properties/post-type-labels.json | 2 +- schemas/properties/post-type-name.json | 2 +- schemas/properties/post-type-rewrite.json | 2 +- schemas/properties/taxonomy-caps.json | 2 +- schemas/properties/taxonomy-labels.json | 2 +- schemas/properties/taxonomy-name.json | 2 +- schemas/properties/taxonomy-rewrite.json | 2 +- schemas/properties/user-cap-name.json | 2 +- schemas/properties/user-caps.json | 2 +- schemas/properties/user-data.json | 2 +- schemas/properties/user-role-name.json | 2 +- schemas/query.json | 2 +- schemas/rest-api/application-password.json | 2 +- schemas/rest-api/attachment.json | 2 +- schemas/rest-api/block-directory-item.json | 2 +- schemas/rest-api/block-pattern-category.json | 2 +- schemas/rest-api/block-pattern.json | 2 +- schemas/rest-api/block-type.json | 2 +- schemas/rest-api/block.json | 2 +- schemas/rest-api/category.json | 2 +- .../collections/application-passwords.json | 2 +- .../collections/block-directory-items.json | 2 +- .../collections/block-pattern-categories.json | 2 +- .../rest-api/collections/block-patterns.json | 2 +- schemas/rest-api/collections/block-types.json | 2 +- schemas/rest-api/collections/blocks.json | 2 +- schemas/rest-api/collections/categories.json | 2 +- schemas/rest-api/collections/comments.json | 2 +- .../collections/font-collections.json | 2 +- schemas/rest-api/collections/font-faces.json | 2 +- .../rest-api/collections/font-families.json | 2 +- schemas/rest-api/collections/media.json | 2 +- schemas/rest-api/collections/menu-items.json | 2 +- .../rest-api/collections/menu-locations.json | 2 +- schemas/rest-api/collections/menus.json | 2 +- schemas/rest-api/collections/pages.json | 2 +- schemas/rest-api/collections/posts.json | 2 +- schemas/rest-api/collections/revisions.json | 2 +- .../rest-api/collections/search-results.json | 2 +- schemas/rest-api/collections/statuses.json | 2 +- schemas/rest-api/collections/tags.json | 2 +- schemas/rest-api/collections/taxonomies.json | 2 +- schemas/rest-api/collections/terms.json | 2 +- schemas/rest-api/collections/types.json | 2 +- schemas/rest-api/collections/users.json | 2 +- schemas/rest-api/comment.json | 2 +- schemas/rest-api/error.json | 2 +- schemas/rest-api/font-collection.json | 2 +- schemas/rest-api/font-face.json | 2 +- schemas/rest-api/font-family.json | 2 +- schemas/rest-api/menu-item.json | 2 +- schemas/rest-api/menu-location.json | 2 +- schemas/rest-api/menu.json | 2 +- schemas/rest-api/page.json | 2 +- schemas/rest-api/partials/post/author.json | 2 +- schemas/rest-api/partials/post/comments.json | 2 +- schemas/rest-api/partials/post/common.json | 2 +- schemas/rest-api/partials/post/excerpt.json | 2 +- schemas/rest-api/partials/post/public.json | 2 +- schemas/rest-api/post.json | 2 +- .../rest-api/properties/date-time-utc.json | 2 +- schemas/rest-api/properties/date-time.json | 2 +- schemas/rest-api/properties/font-face.json | 2 +- .../properties/font-family-settings.json | 2 +- .../rest-api/properties/http-status-code.json | 2 +- schemas/rest-api/properties/object-links.json | 2 +- schemas/rest-api/rendered-block.json | 2 +- schemas/rest-api/revision.json | 2 +- schemas/rest-api/search-result.json | 2 +- schemas/rest-api/settings.json | 2 +- schemas/rest-api/status.json | 2 +- schemas/rest-api/tag.json | 2 +- schemas/rest-api/taxonomy.json | 2 +- schemas/rest-api/term.json | 2 +- schemas/rest-api/type.json | 2 +- schemas/rest-api/user.json | 2 +- schemas/role.json | 2 +- schemas/screen.json | 2 +- schemas/site.json | 2 +- schemas/taxonomy.json | 2 +- schemas/term.json | 2 +- schemas/user.json | 2 +- tests/bin/test.sh | 8 +- tests/external-schemas/hyper-schema.json | 273 ++++++++---------- 109 files changed, 227 insertions(+), 268 deletions(-) diff --git a/package.json b/package.json index 3ddcfca..42bcb6e 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,6 @@ "version": "cd packages/wp-types && npm version $(node -p -e \"require('../../package.json').version\") && git add .", "build-wp-types": "json2ts -i schema.json -o packages/wp-types/index.ts --style.trailingComma=all --style.useTabs && cat packages/wp-types/append.ts >> packages/wp-types/index.ts && sed -i '' 's/export interface WP_REST_API_Partial_/interface WP_REST_API_Partial_/g' packages/wp-types/index.ts", "test-wp-types": "tsc packages/wp-types/tests/test.ts --noEmit --strict --target es2015", - "validate": "ajv compile --strict --strict-schema=false -c ajv-formats -m tests/external-schemas/hyper-schema.json -s schema.json -r \"schemas/**/*.json\"" + "validate": "ajv compile --spec=draft2019 --strict --strict-schema=false -c ajv-formats -m tests/external-schemas/hyper-schema.json -s schema.json -r \"schemas/**/*.json\"" } } diff --git a/schema.json b/schema.json index 35ce564..cac97d3 100644 --- a/schema.json +++ b/schema.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schema.json", "title": "WP", "description": "WordPress is open source software you can use to create a beautiful website, blog, or app.", diff --git a/schemas/block-template.json b/schemas/block-template.json index db68f25..a8a9891 100644 --- a/schemas/block-template.json +++ b/schemas/block-template.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/block-template.json", "title": "WP_Block_Template", "description": "Core class representing a block template.", diff --git a/schemas/block-type.json b/schemas/block-type.json index 0c87544..726b3fa 100644 --- a/schemas/block-type.json +++ b/schemas/block-type.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/block-type.json", "title": "WP_Block_Type", "description": "Core class representing a block type.", diff --git a/schemas/block.json b/schemas/block.json index 6f4f1ae..6bd6677 100644 --- a/schemas/block.json +++ b/schemas/block.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/block.json", "title": "WP_Block", "description": "Class representing a parsed instance of a block.", diff --git a/schemas/comment.json b/schemas/comment.json index a5ab28f..6a50573 100644 --- a/schemas/comment.json +++ b/schemas/comment.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/comment.json", "title": "WP_Comment", "description": "Core class used to organize comments as instantiated objects with defined members.", diff --git a/schemas/error-with-error.json b/schemas/error-with-error.json index 0e979b0..5e2f064 100644 --- a/schemas/error-with-error.json +++ b/schemas/error-with-error.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/error-with-error.json", "title": "WP_Error_With_Error", "description": "WordPress Error class.\n\nRepresents a WP_Error object that contains at least one error.", diff --git a/schemas/error-without-error.json b/schemas/error-without-error.json index a17fc3f..4a3e3f7 100644 --- a/schemas/error-without-error.json +++ b/schemas/error-without-error.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/error-without-error.json", "title": "WP_Error_Without_Error", "description": "Empty WordPress Error class.\n\nRepresents a WP_Error object that contains no errors.", diff --git a/schemas/error.json b/schemas/error.json index 2b16330..c663771 100644 --- a/schemas/error.json +++ b/schemas/error.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/error.json", "title": "WP_Error", "description": "WordPress Error class.\n\nContainer for checking for WordPress errors and error messages. Many core WordPress functions pass this class in the event of an error.", diff --git a/schemas/locale.json b/schemas/locale.json index e392d74..f4ce7dd 100644 --- a/schemas/locale.json +++ b/schemas/locale.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/locale.json", "title": "WP_Locale", "description": "Core class used to store translated data for a locale.", diff --git a/schemas/network.json b/schemas/network.json index d8f3d9a..624d437 100644 --- a/schemas/network.json +++ b/schemas/network.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/network.json", "title": "WP_Network", "description": "Core class used for interacting with a multisite network.", diff --git a/schemas/post-type.json b/schemas/post-type.json index 8581194..74588aa 100644 --- a/schemas/post-type.json +++ b/schemas/post-type.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/post-type.json", "title": "WP_Post_Type", "description": "Core class used for interacting with post types.", diff --git a/schemas/post.json b/schemas/post.json index 3b24b62..be3b12d 100644 --- a/schemas/post.json +++ b/schemas/post.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/post.json", "title": "WP_Post", "description": "Core class used to implement the WP_Post object.", diff --git a/schemas/properties/block-parsed.json b/schemas/properties/block-parsed.json index e193e1d..a28ab16 100644 --- a/schemas/properties/block-parsed.json +++ b/schemas/properties/block-parsed.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/block-parsed.json", "title": "WP_Block_Parsed", "description": "Original parsed array representation of block.", diff --git a/schemas/properties/callable.json b/schemas/properties/callable.json index 2c67f03..54d8a35 100644 --- a/schemas/properties/callable.json +++ b/schemas/properties/callable.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/callable.json", "title": "Callable", "tsType": "any", diff --git a/schemas/properties/comment-status-name.json b/schemas/properties/comment-status-name.json index 02b584a..326a76f 100644 --- a/schemas/properties/comment-status-name.json +++ b/schemas/properties/comment-status-name.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/comment-status-name.json", "title": "WP_Comment_Status_Name", "type": "string", diff --git a/schemas/properties/comment-type-name.json b/schemas/properties/comment-type-name.json index b78cf29..60bb04e 100644 --- a/schemas/properties/comment-type-name.json +++ b/schemas/properties/comment-type-name.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/comment-type-name.json", "title": "WP_Comment_Type_Name", "type": "string", diff --git a/schemas/properties/date-time.json b/schemas/properties/date-time.json index fa7b98d..66df9d3 100644 --- a/schemas/properties/date-time.json +++ b/schemas/properties/date-time.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/date-time.json", "title": "WP_Date_Time", "description": "Timestamp in MySQL DATETIME format (`YYYY-MM-DD hh:mm:ss`).", diff --git a/schemas/properties/error-data.json b/schemas/properties/error-data.json index b2920e1..abbd896 100644 --- a/schemas/properties/error-data.json +++ b/schemas/properties/error-data.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/error-data.json", "title": "WP_Error_Data", "description": "The data for the errors contained within the error object.\n\nEach error is represented by a property keyed by the error code, and containing error data for that code. Any given error code can contain only one piece of error data, but the data can be of any type.", diff --git a/schemas/properties/error-messages.json b/schemas/properties/error-messages.json index c594b81..ad8d0af 100644 --- a/schemas/properties/error-messages.json +++ b/schemas/properties/error-messages.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/error-messages.json", "title": "WP_Error_Messages", "description": "The messages for the errors contained within the error object.\n\nEach error is represented by a property keyed by the error code, and containing an array of message strings for that code. Any given error code usually contains only one message, but can contain more.", diff --git a/schemas/properties/object-filter-context.json b/schemas/properties/object-filter-context.json index 421198a..f0ef7f9 100644 --- a/schemas/properties/object-filter-context.json +++ b/schemas/properties/object-filter-context.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/object-filter-context.json", "title": "WP_Object_Filter_Context", "type": "string", diff --git a/schemas/properties/post-comment-status-name.json b/schemas/properties/post-comment-status-name.json index 3ebdb56..0c2ee01 100644 --- a/schemas/properties/post-comment-status-name.json +++ b/schemas/properties/post-comment-status-name.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/post-comment-status-name.json", "title": "WP_Post_Comment_Status_Name", "type": "string", diff --git a/schemas/properties/post-format-name.json b/schemas/properties/post-format-name.json index b7dc77e..ad696f4 100644 --- a/schemas/properties/post-format-name.json +++ b/schemas/properties/post-format-name.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/post-format-name.json", "title": "WP_Post_Format_Name", "type": "string", diff --git a/schemas/properties/post-status-name.json b/schemas/properties/post-status-name.json index 4a3fa6f..b276c3f 100644 --- a/schemas/properties/post-status-name.json +++ b/schemas/properties/post-status-name.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/post-status-name.json", "title": "WP_Post_Status_Name", "type": "string", diff --git a/schemas/properties/post-type-caps.json b/schemas/properties/post-type-caps.json index fe23f7a..7443a68 100644 --- a/schemas/properties/post-type-caps.json +++ b/schemas/properties/post-type-caps.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/post-type-caps.json", "title": "WP_Post_Type_Caps", "type": "object", diff --git a/schemas/properties/post-type-labels.json b/schemas/properties/post-type-labels.json index 14b366b..65f4519 100644 --- a/schemas/properties/post-type-labels.json +++ b/schemas/properties/post-type-labels.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/post-type-labels.json", "title": "WP_Post_Type_Labels", "type": "object", diff --git a/schemas/properties/post-type-name.json b/schemas/properties/post-type-name.json index 26f225e..aac56ab 100644 --- a/schemas/properties/post-type-name.json +++ b/schemas/properties/post-type-name.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/post-type-name.json", "title": "WP_Post_Type_Name", "type": "string", diff --git a/schemas/properties/post-type-rewrite.json b/schemas/properties/post-type-rewrite.json index 29fd024..8440126 100644 --- a/schemas/properties/post-type-rewrite.json +++ b/schemas/properties/post-type-rewrite.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/post-type-rewrite.json", "title": "WP_Post_Type_Rewrite", "type": "object", diff --git a/schemas/properties/taxonomy-caps.json b/schemas/properties/taxonomy-caps.json index 0b95b64..a21db09 100644 --- a/schemas/properties/taxonomy-caps.json +++ b/schemas/properties/taxonomy-caps.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/taxonomy-caps.json", "title": "WP_Taxonomy_Caps", "type": "object", diff --git a/schemas/properties/taxonomy-labels.json b/schemas/properties/taxonomy-labels.json index 1c4da20..5068def 100644 --- a/schemas/properties/taxonomy-labels.json +++ b/schemas/properties/taxonomy-labels.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/taxonomy-labels.json", "title": "WP_Taxonomy_Labels", "type": "object", diff --git a/schemas/properties/taxonomy-name.json b/schemas/properties/taxonomy-name.json index b9b8d36..d6befc9 100644 --- a/schemas/properties/taxonomy-name.json +++ b/schemas/properties/taxonomy-name.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/taxonomy-name.json", "title": "WP_Taxonomy_Name", "type": "string", diff --git a/schemas/properties/taxonomy-rewrite.json b/schemas/properties/taxonomy-rewrite.json index 354bfeb..5ac0777 100644 --- a/schemas/properties/taxonomy-rewrite.json +++ b/schemas/properties/taxonomy-rewrite.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/taxonomy-rewrite.json", "title": "WP_Taxonomy_Rewrite", "type": "object", diff --git a/schemas/properties/user-cap-name.json b/schemas/properties/user-cap-name.json index 5d953b7..4d9213c 100644 --- a/schemas/properties/user-cap-name.json +++ b/schemas/properties/user-cap-name.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/user-cap-name.json", "title": "WP_User_Cap_Name", "type": "string", diff --git a/schemas/properties/user-caps.json b/schemas/properties/user-caps.json index 9d10081..71de575 100644 --- a/schemas/properties/user-caps.json +++ b/schemas/properties/user-caps.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/user-caps.json", "title": "WP_User_Caps", "type": "object", diff --git a/schemas/properties/user-data.json b/schemas/properties/user-data.json index 634e6ed..0f7c4a6 100644 --- a/schemas/properties/user-data.json +++ b/schemas/properties/user-data.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/user-data.json", "title": "WP_User_Data", "type": "object", diff --git a/schemas/properties/user-role-name.json b/schemas/properties/user-role-name.json index aa13d67..add0a5a 100644 --- a/schemas/properties/user-role-name.json +++ b/schemas/properties/user-role-name.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/properties/user-role-name.json", "title": "WP_User_Role_Name", "type": "string", diff --git a/schemas/query.json b/schemas/query.json index 29d6dc9..8b2c925 100644 --- a/schemas/query.json +++ b/schemas/query.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/query.json", "title": "WP_Query", "description": "The WordPress Query class.", diff --git a/schemas/rest-api/application-password.json b/schemas/rest-api/application-password.json index 19572e4..951fea5 100644 --- a/schemas/rest-api/application-password.json +++ b/schemas/rest-api/application-password.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/application-password.json", "title": "WP_REST_API_Application_Password", "description": "A user application password in a REST API context.", diff --git a/schemas/rest-api/attachment.json b/schemas/rest-api/attachment.json index 6659acf..acbc2e2 100644 --- a/schemas/rest-api/attachment.json +++ b/schemas/rest-api/attachment.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/attachment.json", "title": "WP_REST_API_Attachment", "description": "A media attachment object in a REST API context.", diff --git a/schemas/rest-api/block-directory-item.json b/schemas/rest-api/block-directory-item.json index ed3a594..8eaf837 100644 --- a/schemas/rest-api/block-directory-item.json +++ b/schemas/rest-api/block-directory-item.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/block-directory-item.json", "title": "WP_REST_API_Block_Directory_Item", "description": "A block directory search result in a REST API context.", diff --git a/schemas/rest-api/block-pattern-category.json b/schemas/rest-api/block-pattern-category.json index b8e9724..032471a 100644 --- a/schemas/rest-api/block-pattern-category.json +++ b/schemas/rest-api/block-pattern-category.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/block-pattern-category.json", "title": "WP_REST_API_Block_Pattern_Category", "description": "A block pattern category in a REST API context.", diff --git a/schemas/rest-api/block-pattern.json b/schemas/rest-api/block-pattern.json index 17c36df..e9002e1 100644 --- a/schemas/rest-api/block-pattern.json +++ b/schemas/rest-api/block-pattern.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/block-pattern.json", "title": "WP_REST_API_Block_Pattern", "description": "A block pattern in a REST API context.", diff --git a/schemas/rest-api/block-type.json b/schemas/rest-api/block-type.json index 0f68b89..add97e9 100644 --- a/schemas/rest-api/block-type.json +++ b/schemas/rest-api/block-type.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/block-type.json", "title": "WP_REST_API_Block_Type", "description": "A block type object in a REST API context.", diff --git a/schemas/rest-api/block.json b/schemas/rest-api/block.json index 19be0a7..5873e16 100644 --- a/schemas/rest-api/block.json +++ b/schemas/rest-api/block.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/block.json", "title": "WP_REST_API_Block", "description": "A reusable block object in a REST API context.", diff --git a/schemas/rest-api/category.json b/schemas/rest-api/category.json index 9e23be1..579faf4 100644 --- a/schemas/rest-api/category.json +++ b/schemas/rest-api/category.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/category.json", "title": "WP_REST_API_Category", "description": "A post category object in a REST API context.", diff --git a/schemas/rest-api/collections/application-passwords.json b/schemas/rest-api/collections/application-passwords.json index 78ef31f..be947ff 100644 --- a/schemas/rest-api/collections/application-passwords.json +++ b/schemas/rest-api/collections/application-passwords.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/application-passwords.json", "title": "WP_REST_API_Application_Passwords", "description": "A collection of user application passwords in a REST API context.", diff --git a/schemas/rest-api/collections/block-directory-items.json b/schemas/rest-api/collections/block-directory-items.json index a18e829..de0cd6d 100644 --- a/schemas/rest-api/collections/block-directory-items.json +++ b/schemas/rest-api/collections/block-directory-items.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/block-directory-items.json", "title": "WP_REST_API_Block_Directory_Items", "description": "A collection of block directory search results in a REST API context.", diff --git a/schemas/rest-api/collections/block-pattern-categories.json b/schemas/rest-api/collections/block-pattern-categories.json index 42919db..fc21c04 100644 --- a/schemas/rest-api/collections/block-pattern-categories.json +++ b/schemas/rest-api/collections/block-pattern-categories.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/block-pattern-categories.json", "title": "WP_REST_API_Block_Pattern_Categories", "description": "A collection of block pattern categories in a REST API context.", diff --git a/schemas/rest-api/collections/block-patterns.json b/schemas/rest-api/collections/block-patterns.json index 673caab..18ebc0e 100644 --- a/schemas/rest-api/collections/block-patterns.json +++ b/schemas/rest-api/collections/block-patterns.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/block-patterns.json", "title": "WP_REST_API_Block_Patterns", "description": "A collection of block patterns in a REST API context.", diff --git a/schemas/rest-api/collections/block-types.json b/schemas/rest-api/collections/block-types.json index 2162604..7590a26 100644 --- a/schemas/rest-api/collections/block-types.json +++ b/schemas/rest-api/collections/block-types.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/block-types.json", "title": "WP_REST_API_Block_Types", "description": "A collection of block type objects in a REST API context.", diff --git a/schemas/rest-api/collections/blocks.json b/schemas/rest-api/collections/blocks.json index 7847640..61ecfcb 100644 --- a/schemas/rest-api/collections/blocks.json +++ b/schemas/rest-api/collections/blocks.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/blocks.json", "title": "WP_REST_API_Blocks", "description": "A collection of reusable block objects in a REST API context.", diff --git a/schemas/rest-api/collections/categories.json b/schemas/rest-api/collections/categories.json index 466e40f..bdbe94d 100644 --- a/schemas/rest-api/collections/categories.json +++ b/schemas/rest-api/collections/categories.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/categories.json", "title": "WP_REST_API_Categories", "description": "A collection of post category objects in a REST API context.", diff --git a/schemas/rest-api/collections/comments.json b/schemas/rest-api/collections/comments.json index 390f8bd..9db5ae9 100644 --- a/schemas/rest-api/collections/comments.json +++ b/schemas/rest-api/collections/comments.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/comments.json", "title": "WP_REST_API_Comments", "description": "A collection of comment objects in a REST API context.", diff --git a/schemas/rest-api/collections/font-collections.json b/schemas/rest-api/collections/font-collections.json index a865fc1..98e6b15 100644 --- a/schemas/rest-api/collections/font-collections.json +++ b/schemas/rest-api/collections/font-collections.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/font-collections.json", "title": "WP_REST_API_Font_Collections", "description": "A collection of font collection objects in a REST API context.", diff --git a/schemas/rest-api/collections/font-faces.json b/schemas/rest-api/collections/font-faces.json index caef5e7..11a0bdd 100644 --- a/schemas/rest-api/collections/font-faces.json +++ b/schemas/rest-api/collections/font-faces.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/font-faces.json", "title": "WP_REST_API_Font_Faces", "description": "A collection of font face objects in a REST API context.", diff --git a/schemas/rest-api/collections/font-families.json b/schemas/rest-api/collections/font-families.json index 7a1a895..2204ce4 100644 --- a/schemas/rest-api/collections/font-families.json +++ b/schemas/rest-api/collections/font-families.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/font-families.json", "title": "WP_REST_API_Font_Families", "description": "A collection of font family objects in a REST API context.", diff --git a/schemas/rest-api/collections/media.json b/schemas/rest-api/collections/media.json index 117a501..8265415 100644 --- a/schemas/rest-api/collections/media.json +++ b/schemas/rest-api/collections/media.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/media.json", "title": "WP_REST_API_Attachments", "description": "A collection of media attachment objects in a REST API context.", diff --git a/schemas/rest-api/collections/menu-items.json b/schemas/rest-api/collections/menu-items.json index bf97f3d..bf6c719 100644 --- a/schemas/rest-api/collections/menu-items.json +++ b/schemas/rest-api/collections/menu-items.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/menu-items.json", "title": "WP_REST_API_Menu_Items", "description": "A collection of menu items in a REST API context.", diff --git a/schemas/rest-api/collections/menu-locations.json b/schemas/rest-api/collections/menu-locations.json index 95b1a36..3c07252 100644 --- a/schemas/rest-api/collections/menu-locations.json +++ b/schemas/rest-api/collections/menu-locations.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/menu-locations.json", "title": "WP_REST_API_Menu_Locations", "description": "A collection of menu locations in a REST API context.", diff --git a/schemas/rest-api/collections/menus.json b/schemas/rest-api/collections/menus.json index bddb4c9..f30567e 100644 --- a/schemas/rest-api/collections/menus.json +++ b/schemas/rest-api/collections/menus.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/menus.json", "title": "WP_REST_API_Menus", "description": "A collection of menus in a REST API context.", diff --git a/schemas/rest-api/collections/pages.json b/schemas/rest-api/collections/pages.json index e1f2435..3e27c51 100644 --- a/schemas/rest-api/collections/pages.json +++ b/schemas/rest-api/collections/pages.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/pages.json", "title": "WP_REST_API_Pages", "description": "A collection of page objects in a REST API context.", diff --git a/schemas/rest-api/collections/posts.json b/schemas/rest-api/collections/posts.json index 9c4ad6a..a65f8e7 100644 --- a/schemas/rest-api/collections/posts.json +++ b/schemas/rest-api/collections/posts.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/posts.json", "title": "WP_REST_API_Posts", "description": "A collection of post objects in a REST API context.", diff --git a/schemas/rest-api/collections/revisions.json b/schemas/rest-api/collections/revisions.json index 2c34ff7..3e5fda1 100644 --- a/schemas/rest-api/collections/revisions.json +++ b/schemas/rest-api/collections/revisions.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/revisions.json", "title": "WP_REST_API_Revisions", "description": "A collection of post revision objects in a REST API context.", diff --git a/schemas/rest-api/collections/search-results.json b/schemas/rest-api/collections/search-results.json index 8e8c3e3..0d8225f 100644 --- a/schemas/rest-api/collections/search-results.json +++ b/schemas/rest-api/collections/search-results.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/search-results.json", "title": "WP_REST_API_Search_Results", "description": "A collection of search result objects in a REST API context.", diff --git a/schemas/rest-api/collections/statuses.json b/schemas/rest-api/collections/statuses.json index c98edd0..3acbd5d 100644 --- a/schemas/rest-api/collections/statuses.json +++ b/schemas/rest-api/collections/statuses.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/statuses.json", "title": "WP_REST_API_Statuses", "description": "A collection of post status objects in a REST API context.", diff --git a/schemas/rest-api/collections/tags.json b/schemas/rest-api/collections/tags.json index dc7d7f6..201f53a 100644 --- a/schemas/rest-api/collections/tags.json +++ b/schemas/rest-api/collections/tags.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/tags.json", "title": "WP_REST_API_Tags", "description": "A collection of post tag objects in a REST API context.", diff --git a/schemas/rest-api/collections/taxonomies.json b/schemas/rest-api/collections/taxonomies.json index e5eac05..5bf823a 100644 --- a/schemas/rest-api/collections/taxonomies.json +++ b/schemas/rest-api/collections/taxonomies.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/taxonomies.json", "title": "WP_REST_API_Taxonomies", "description": "A collection of taxonomy objects in a REST API context.", diff --git a/schemas/rest-api/collections/terms.json b/schemas/rest-api/collections/terms.json index 072f7cc..44b4951 100644 --- a/schemas/rest-api/collections/terms.json +++ b/schemas/rest-api/collections/terms.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/terms.json", "title": "WP_REST_API_Terms", "description": "A collection of term objects in a REST API context.", diff --git a/schemas/rest-api/collections/types.json b/schemas/rest-api/collections/types.json index cb4e5a7..20b7804 100644 --- a/schemas/rest-api/collections/types.json +++ b/schemas/rest-api/collections/types.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/types.json", "title": "WP_REST_API_Types", "description": "A collection of post type objects in a REST API context.", diff --git a/schemas/rest-api/collections/users.json b/schemas/rest-api/collections/users.json index 5232dcc..e4cddfc 100644 --- a/schemas/rest-api/collections/users.json +++ b/schemas/rest-api/collections/users.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/collections/users.json", "title": "WP_REST_API_Users", "description": "A collection of user objects in a REST API context.", diff --git a/schemas/rest-api/comment.json b/schemas/rest-api/comment.json index fca9557..a32db57 100644 --- a/schemas/rest-api/comment.json +++ b/schemas/rest-api/comment.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/comment.json", "title": "WP_REST_API_Comment", "description": "A comment object in a REST API context.", diff --git a/schemas/rest-api/error.json b/schemas/rest-api/error.json index 2eab5e2..33a8c30 100644 --- a/schemas/rest-api/error.json +++ b/schemas/rest-api/error.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/error.json", "title": "WP_REST_API_Error", "description": "A REST API error response.", diff --git a/schemas/rest-api/font-collection.json b/schemas/rest-api/font-collection.json index 37aa8b5..eda1db7 100644 --- a/schemas/rest-api/font-collection.json +++ b/schemas/rest-api/font-collection.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/font-collection.json", "title": "WP_REST_API_Font_Collection", "description": "A font collection object in a REST API context.", diff --git a/schemas/rest-api/font-face.json b/schemas/rest-api/font-face.json index a118a60..6c7465f 100644 --- a/schemas/rest-api/font-face.json +++ b/schemas/rest-api/font-face.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/font-face.json", "title": "WP_REST_API_Font_Face", "description": "A font face object in a REST API context.", diff --git a/schemas/rest-api/font-family.json b/schemas/rest-api/font-family.json index f8c5414..e7510ae 100644 --- a/schemas/rest-api/font-family.json +++ b/schemas/rest-api/font-family.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/font-family.json", "title": "WP_REST_API_Font_Family", "description": "A font family object in a REST API context.", diff --git a/schemas/rest-api/menu-item.json b/schemas/rest-api/menu-item.json index a11121c..81be1a2 100644 --- a/schemas/rest-api/menu-item.json +++ b/schemas/rest-api/menu-item.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/menu-item.json", "title": "WP_REST_API_Menu_Item", "description": "A menu item in a REST API context.", diff --git a/schemas/rest-api/menu-location.json b/schemas/rest-api/menu-location.json index 2d99d14..e516c7c 100644 --- a/schemas/rest-api/menu-location.json +++ b/schemas/rest-api/menu-location.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/menu-location.json", "title": "WP_REST_API_Menu_Location", "description": "A menu location in a REST API context.", diff --git a/schemas/rest-api/menu.json b/schemas/rest-api/menu.json index 4c01e68..57ca4a4 100644 --- a/schemas/rest-api/menu.json +++ b/schemas/rest-api/menu.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/menu.json", "title": "WP_REST_API_Menu", "description": "A menu in a REST API context.", diff --git a/schemas/rest-api/page.json b/schemas/rest-api/page.json index c94e5ae..317ae34 100644 --- a/schemas/rest-api/page.json +++ b/schemas/rest-api/page.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/page.json", "title": "WP_REST_API_Page", "description": "A page object in a REST API context.", diff --git a/schemas/rest-api/partials/post/author.json b/schemas/rest-api/partials/post/author.json index 4416108..34ce58f 100644 --- a/schemas/rest-api/partials/post/author.json +++ b/schemas/rest-api/partials/post/author.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/partials/post/author.json", "title": "WP_REST_API_Partial_Post_Author", "description": "Hello.", diff --git a/schemas/rest-api/partials/post/comments.json b/schemas/rest-api/partials/post/comments.json index 63f65ff..d0405c7 100644 --- a/schemas/rest-api/partials/post/comments.json +++ b/schemas/rest-api/partials/post/comments.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/partials/post/comments.json", "title": "WP_REST_API_Partial_Post_Comments", "description": "Properties for post types that support comments", diff --git a/schemas/rest-api/partials/post/common.json b/schemas/rest-api/partials/post/common.json index 68ec375..2fbb577 100644 --- a/schemas/rest-api/partials/post/common.json +++ b/schemas/rest-api/partials/post/common.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/partials/post/common.json", "title": "WP_REST_API_Partial_Post_Common", "description": "Common post properties", diff --git a/schemas/rest-api/partials/post/excerpt.json b/schemas/rest-api/partials/post/excerpt.json index 65738b9..6da1d48 100644 --- a/schemas/rest-api/partials/post/excerpt.json +++ b/schemas/rest-api/partials/post/excerpt.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/partials/post/excerpt.json", "title": "WP_REST_API_Partial_Post_Excerpt", "description": "Properties for post types that support an excerpt", diff --git a/schemas/rest-api/partials/post/public.json b/schemas/rest-api/partials/post/public.json index de69ba5..acd33e7 100644 --- a/schemas/rest-api/partials/post/public.json +++ b/schemas/rest-api/partials/post/public.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/partials/post/public.json", "title": "WP_REST_API_Partial_Post_Public", "description": "Properties for public post types", diff --git a/schemas/rest-api/post.json b/schemas/rest-api/post.json index 00d97f1..1190144 100644 --- a/schemas/rest-api/post.json +++ b/schemas/rest-api/post.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/post.json", "title": "WP_REST_API_Post", "description": "A post object in a REST API context.", diff --git a/schemas/rest-api/properties/date-time-utc.json b/schemas/rest-api/properties/date-time-utc.json index 02e1cf8..f0c23fb 100644 --- a/schemas/rest-api/properties/date-time-utc.json +++ b/schemas/rest-api/properties/date-time-utc.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/properties/date-time-utc.json", "title": "WP_REST_API_Date_Time_UTC", "description": "UTC timestamp in IETF RFC 3339 date-time format (`YYYY-MM-DDThh:mm:ss+00:00`).", diff --git a/schemas/rest-api/properties/date-time.json b/schemas/rest-api/properties/date-time.json index 6017309..978a4c8 100644 --- a/schemas/rest-api/properties/date-time.json +++ b/schemas/rest-api/properties/date-time.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/properties/date-time.json", "title": "WP_REST_API_Date_Time", "description": "Timestamp in IETF RFC 3339 date-time format minus the timezone identifier (`YYYY-MM-DDThh:mm:ss`).", diff --git a/schemas/rest-api/properties/font-face.json b/schemas/rest-api/properties/font-face.json index 2587799..e50adc1 100644 --- a/schemas/rest-api/properties/font-face.json +++ b/schemas/rest-api/properties/font-face.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/properties/font-face.json", "title": "WP_Font_Face", "description": "A font face.", diff --git a/schemas/rest-api/properties/font-family-settings.json b/schemas/rest-api/properties/font-family-settings.json index d66ee7d..39b65f8 100644 --- a/schemas/rest-api/properties/font-family-settings.json +++ b/schemas/rest-api/properties/font-family-settings.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/properties/font-family-settings.json", "title": "WP_Font_Family_Settings", "description": "Font family settings.", diff --git a/schemas/rest-api/properties/http-status-code.json b/schemas/rest-api/properties/http-status-code.json index ce4cc77..0cb59c1 100644 --- a/schemas/rest-api/properties/http-status-code.json +++ b/schemas/rest-api/properties/http-status-code.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/properties/http-status-code.json", "title": "WP_Http_Status_Code", "type": "integer", diff --git a/schemas/rest-api/properties/object-links.json b/schemas/rest-api/properties/object-links.json index ddfd831..ae037b6 100644 --- a/schemas/rest-api/properties/object-links.json +++ b/schemas/rest-api/properties/object-links.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/properties/object-links.json", "title": "WP_REST_API_Object_Links", "description": "The relations for the object and its properties.", diff --git a/schemas/rest-api/rendered-block.json b/schemas/rest-api/rendered-block.json index d395252..7be2a2a 100644 --- a/schemas/rest-api/rendered-block.json +++ b/schemas/rest-api/rendered-block.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/rendered-block.json", "title": "WP_REST_API_Rendered_Block", "description": "A rendered dynamic block in a REST API context. Only accessible with the 'edit' context.", diff --git a/schemas/rest-api/revision.json b/schemas/rest-api/revision.json index 0d817ee..b20c3e7 100644 --- a/schemas/rest-api/revision.json +++ b/schemas/rest-api/revision.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/revision.json", "title": "WP_REST_API_Revision", "description": "A post revision object in a REST API context.", diff --git a/schemas/rest-api/search-result.json b/schemas/rest-api/search-result.json index 2e40e00..e852cb6 100644 --- a/schemas/rest-api/search-result.json +++ b/schemas/rest-api/search-result.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/search-result.json", "title": "WP_REST_API_Search_Result", "description": "A search result in a REST API context.", diff --git a/schemas/rest-api/settings.json b/schemas/rest-api/settings.json index 1f0966a..4285b49 100644 --- a/schemas/rest-api/settings.json +++ b/schemas/rest-api/settings.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/settings.json", "title": "WP_REST_API_Settings", "description": "Site settings in a REST API context.", diff --git a/schemas/rest-api/status.json b/schemas/rest-api/status.json index ffba2e2..706a4c8 100644 --- a/schemas/rest-api/status.json +++ b/schemas/rest-api/status.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/status.json", "title": "WP_REST_API_Status", "description": "A post status object in a REST API context.", diff --git a/schemas/rest-api/tag.json b/schemas/rest-api/tag.json index e612592..6402508 100644 --- a/schemas/rest-api/tag.json +++ b/schemas/rest-api/tag.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/tag.json", "title": "WP_REST_API_Tag", "description": "A post tag object in a REST API context.", diff --git a/schemas/rest-api/taxonomy.json b/schemas/rest-api/taxonomy.json index 6a6326f..c4318ba 100644 --- a/schemas/rest-api/taxonomy.json +++ b/schemas/rest-api/taxonomy.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/taxonomy.json", "title": "WP_REST_API_Taxonomy", "description": "A taxonomy in a REST API context.", diff --git a/schemas/rest-api/term.json b/schemas/rest-api/term.json index 8fb6098..8f5159f 100644 --- a/schemas/rest-api/term.json +++ b/schemas/rest-api/term.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/term.json", "title": "WP_REST_API_Term", "description": "A taxonomy term object in a REST API context.", diff --git a/schemas/rest-api/type.json b/schemas/rest-api/type.json index 3cb374c..7345cf3 100644 --- a/schemas/rest-api/type.json +++ b/schemas/rest-api/type.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/type.json", "title": "WP_REST_API_Type", "description": "A post type object in a REST API context.", diff --git a/schemas/rest-api/user.json b/schemas/rest-api/user.json index ae5ecf3..4e609c6 100644 --- a/schemas/rest-api/user.json +++ b/schemas/rest-api/user.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/rest-api/user.json", "title": "WP_REST_API_User", "description": "A user object in a REST API context.", diff --git a/schemas/role.json b/schemas/role.json index 690ab2a..c69e2d4 100644 --- a/schemas/role.json +++ b/schemas/role.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/role.json", "title": "WP_Role", "description": "Core class used to extend the user roles API.", diff --git a/schemas/screen.json b/schemas/screen.json index f6bd05c..76aadb5 100644 --- a/schemas/screen.json +++ b/schemas/screen.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/screen.json", "title": "WP_Screen", "description": "Core class used to implement an admin screen API.", diff --git a/schemas/site.json b/schemas/site.json index dcd8f47..533a652 100644 --- a/schemas/site.json +++ b/schemas/site.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/site.json", "title": "WP_Site", "description": "Core class used for interacting with a multisite site.", diff --git a/schemas/taxonomy.json b/schemas/taxonomy.json index a334097..257016f 100644 --- a/schemas/taxonomy.json +++ b/schemas/taxonomy.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/taxonomy.json", "title": "WP_Taxonomy", "description": "Core class used for interacting with taxonomies.", diff --git a/schemas/term.json b/schemas/term.json index 5b25721..6eeefd4 100644 --- a/schemas/term.json +++ b/schemas/term.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/term.json", "title": "WP_Term", "description": "Core class used to implement the WP_Term object.", diff --git a/schemas/user.json b/schemas/user.json index 577e24f..72b54a7 100644 --- a/schemas/user.json +++ b/schemas/user.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://raw.githubusercontent.com/johnbillion/wp-json-schemas/trunk/schemas/user.json", "title": "WP_User", "description": "Core class used to implement the WP_User object.", diff --git a/tests/bin/test.sh b/tests/bin/test.sh index 3b6331f..49f8926 100755 --- a/tests/bin/test.sh +++ b/tests/bin/test.sh @@ -15,10 +15,10 @@ function validate_schema() { local filename=${base/.json/} ls tests/data/$filename/*.json > /dev/null - ./node_modules/.bin/ajv validate --strict --strict-schema=false -c ajv-formats -m tests/external-schemas/hyper-schema.json -r schema.json -r $rflag -s "$file" -d "tests/data/$filename/*.json" + ./node_modules/.bin/ajv validate --spec=draft2019 --strict --strict-schema=false -c ajv-formats -m tests/external-schemas/hyper-schema.json -r schema.json -r $rflag -s "$file" -d "tests/data/$filename/*.json" } -IGNORE_FILES=("schemas/rest-api/error.json" "schemas/rest-api/category.json" "schemas/rest-api/tag.json" "schemas/rest-api/page.json") +IGNORE_FILES=("schemas/rest-api/error.json") for file in schemas/*.json do @@ -31,7 +31,7 @@ do then continue fi - ./node_modules/node-jq/bin/jq --tab '. + { "additionalProperties": false }' "$file" > tmp && mv tmp "$file" + ./node_modules/node-jq/bin/jq --tab '. + { "unevaluatedProperties": false }' "$file" > tmp && mv tmp "$file" done for file in schemas/rest-api/collections/*.json @@ -45,5 +45,5 @@ do then continue fi - ./node_modules/node-jq/bin/jq --tab 'del(.additionalProperties)' "$file" > tmp && mv tmp "$file" + ./node_modules/node-jq/bin/jq --tab 'del(.unevaluatedProperties)' "$file" > tmp && mv tmp "$file" done diff --git a/tests/external-schemas/hyper-schema.json b/tests/external-schemas/hyper-schema.json index 07f5057..3c28c1f 100644 --- a/tests/external-schemas/hyper-schema.json +++ b/tests/external-schemas/hyper-schema.json @@ -1,174 +1,133 @@ { - "$schema": "http://json-schema.org/draft-07/hyper-schema#", - "$id": "http://json-schema.org/draft-07/hyper-schema#", + "$schema": "https://json-schema.org/draft/2019-09/hyper-schema", + "$id": "https://json-schema.org/draft/2019-09/hyper-schema", + "$vocabulary": { + "https://json-schema.org/draft/2019-09/vocab/core": true, + "https://json-schema.org/draft/2019-09/vocab/applicator": true, + "https://json-schema.org/draft/2019-09/vocab/validation": true, + "https://json-schema.org/draft/2019-09/vocab/meta-data": true, + "https://json-schema.org/draft/2019-09/vocab/format": false, + "https://json-schema.org/draft/2019-09/vocab/content": true, + "https://json-schema.org/draft/2019-09/vocab/hyper-schema": true + }, + "$recursiveAnchor": true, "title": "JSON Hyper-Schema", "allOf": [ { - "$ref": "http://json-schema.org/draft-07/schema#" - } - ], - "properties": { - "additionalItems": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#" - } - ] + "$ref": "https://json-schema.org/draft/2019-09/schema" }, - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#" - } - ] - }, - "dependencies": { - "additionalProperties": { - "anyOf": [ - { - "$ref": "#" - }, - { - "type": "array" - } - ] - } - }, - "items": { - "anyOf": [ - { - "$ref": "#" - }, - { - "$ref": "#/definitions/schemaArray" - } - ] - }, - "definitions": { - "additionalProperties": { - "$ref": "#" - } - }, - "patternProperties": { - "additionalProperties": { - "$ref": "#" - } - }, - "properties": { - "additionalProperties": { - "$ref": "#" - } - }, - "allOf": { - "$ref": "#/definitions/schemaArray" - }, - "anyOf": { - "$ref": "#/definitions/schemaArray" - }, - "oneOf": { - "$ref": "#/definitions/schemaArray" - }, - "not": { - "$ref": "#" - }, - "links": { - "type": "array", - "items": { - "$ref": "#/definitions/linkDescription" - } - }, - "fragmentResolution": { - "type": "string" - }, - "media": { - "type": "object", - "properties": { - "type": { - "description": "A media type, as described in RFC 2046", - "type": "string" - }, - "binaryEncoding": { - "description": "A content encoding scheme, as described in RFC 2045", - "type": "string" - } - } - }, - "pathStart": { - "description": "Instances' URIs must start with this value for this schema to apply to them", - "type": "string", - "format": "uri" - } - }, - "definitions": { - "schemaArray": { - "type": "array", - "items": { - "$ref": "#" - } - }, - "linkDescription": { - "title": "Link Description Object", - "type": "object", - "required": [ - "href", - "rel" - ], + { "properties": { - "href": { - "description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing", - "type": "string" - }, - "rel": { - "description": "relation to the target resource of the link", - "type": "string" - }, - "title": { - "description": "a title for the link", - "type": "string" - }, - "targetSchema": { - "description": "JSON Schema describing the link target", - "$ref": "#" - }, - "mediaType": { - "description": "media type (as defined by RFC 2046) describing the link target", - "type": "string" - }, - "method": { - "description": "method for requesting the target of the link (e.g. for HTTP this might be \"GET\" or \"DELETE\")", - "type": "string" - }, - "encType": { - "description": "The media type in which to submit data along with the request", + "base": { "type": "string", - "default": "application/json" + "format": "uri-template" }, - "schema": { - "description": "Schema describing the data to submit along with the request", - "$ref": "#" + "links": { + "type": "array", + "items": { + "type": "object", + "required": [ + "rel", + "href" + ], + "properties": { + "anchor": { + "type": "string", + "format": "uri-template" + }, + "anchorPointer": { + "type": "string", + "anyOf": [ + { + "format": "json-pointer" + }, + { + "format": "relative-json-pointer" + } + ] + }, + "rel": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + ] + }, + "href": { + "type": "string", + "format": "uri-template" + }, + "hrefSchema": { + "$ref": "https://json-schema.org/draft/2019-09/hyper-schema", + "default": false + }, + "templatePointers": { + "type": "object", + "additionalProperties": { + "type": "string", + "anyOf": [ + { + "format": "json-pointer" + }, + { + "format": "relative-json-pointer" + } + ] + } + }, + "templateRequired": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "targetSchema": { + "$ref": "https://json-schema.org/draft/2019-09/hyper-schema", + "default": true + }, + "targetMediaType": { + "type": "string" + }, + "targetHints": {}, + "headerSchema": { + "$ref": "https://json-schema.org/draft/2019-09/hyper-schema", + "default": true + }, + "submissionMediaType": { + "type": "string", + "default": "application/json" + }, + "submissionSchema": { + "$ref": "https://json-schema.org/draft/2019-09/hyper-schema", + "default": true + }, + "$comment": { + "type": "string" + } + } + } } } - }, - "readOnly": { - "description": "If true, indicates that the value of this property is controlled by the server.", - "type": "boolean", - "default": false } - }, + ], "links": [ { "rel": "self", - "href": "{+id}" - }, - { - "rel": "full", - "href": "{+($ref)}" + "href": "{+%24id}" } ] } From 7147d21040814bf0e7db4aa8b3795d268e587ad2 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 20 Aug 2024 22:08:46 +0100 Subject: [PATCH 7/9] Cross-platform sed is a pain. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 42bcb6e..91a5be2 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "scripts": { "version": "cd packages/wp-types && npm version $(node -p -e \"require('../../package.json').version\") && git add .", - "build-wp-types": "json2ts -i schema.json -o packages/wp-types/index.ts --style.trailingComma=all --style.useTabs && cat packages/wp-types/append.ts >> packages/wp-types/index.ts && sed -i '' 's/export interface WP_REST_API_Partial_/interface WP_REST_API_Partial_/g' packages/wp-types/index.ts", + "build-wp-types": "json2ts -i schema.json -o packages/wp-types/index.ts --style.trailingComma=all --style.useTabs && cat packages/wp-types/append.ts >> packages/wp-types/index.ts && sed -i.bak 's/export interface WP_REST_API_Partial_/interface WP_REST_API_Partial_/g' packages/wp-types/index.ts && rm packages/wp-types/index.ts.bak", "test-wp-types": "tsc packages/wp-types/tests/test.ts --noEmit --strict --target es2015", "validate": "ajv compile --spec=draft2019 --strict --strict-schema=false -c ajv-formats -m tests/external-schemas/hyper-schema.json -s schema.json -r \"schemas/**/*.json\"" } From 0de34549ca2e867ac534b99902a876d3ff20408e Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 20 Aug 2024 22:19:47 +0100 Subject: [PATCH 8/9] Move the build command into its own script. --- composer.json | 2 +- package.json | 1 - tests/bin/build-wp-types.sh | 10 ++++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100755 tests/bin/build-wp-types.sh diff --git a/composer.json b/composer.json index 32fdcad..4391767 100644 --- a/composer.json +++ b/composer.json @@ -60,7 +60,7 @@ "@php -r \"file_exists( 'tests/wordpress/wp-content/db.php' ) || copy( 'tests/wordpress/wp-content/plugins/sqlite-database-integration/db.copy', 'tests/wordpress/wp-content/db.php' );\"", "npm run validate", - "npm run build-wp-types", + "./tests/bin/build-wp-types.sh", "npm run test-wp-types", "rm -f tests/wordpress/wp-content/database/.ht.sqlite", diff --git a/package.json b/package.json index 91a5be2..ae93722 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ }, "scripts": { "version": "cd packages/wp-types && npm version $(node -p -e \"require('../../package.json').version\") && git add .", - "build-wp-types": "json2ts -i schema.json -o packages/wp-types/index.ts --style.trailingComma=all --style.useTabs && cat packages/wp-types/append.ts >> packages/wp-types/index.ts && sed -i.bak 's/export interface WP_REST_API_Partial_/interface WP_REST_API_Partial_/g' packages/wp-types/index.ts && rm packages/wp-types/index.ts.bak", "test-wp-types": "tsc packages/wp-types/tests/test.ts --noEmit --strict --target es2015", "validate": "ajv compile --spec=draft2019 --strict --strict-schema=false -c ajv-formats -m tests/external-schemas/hyper-schema.json -s schema.json -r \"schemas/**/*.json\"" } diff --git a/tests/bin/build-wp-types.sh b/tests/bin/build-wp-types.sh new file mode 100755 index 0000000..ac37271 --- /dev/null +++ b/tests/bin/build-wp-types.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# -e Exit immediately if a pipeline returns a non-zero status +# -o pipefail Produce a failure return code if any command errors +set -eo pipefail + +./node_modules/.bin/json2ts -i schema.json -o packages/wp-types/index.ts --style.trailingComma=all --style.useTabs +cat packages/wp-types/append.ts >> packages/wp-types/index.ts +sed -i.bak 's/export interface WP_REST_API_Partial_/interface WP_REST_API_Partial_/g' packages/wp-types/index.ts +rm packages/wp-types/index.ts.bak From 9a74435978fe19f7fc318d9287c4f37eb13f3da3 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 20 Aug 2024 22:22:02 +0100 Subject: [PATCH 9/9] Get rid of additional properties in partials. --- packages/wp-types/index.ts | 5 ----- tests/bin/build-wp-types.sh | 11 +++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/wp-types/index.ts b/packages/wp-types/index.ts index 06cd17a..747f522 100644 --- a/packages/wp-types/index.ts +++ b/packages/wp-types/index.ts @@ -2305,7 +2305,6 @@ interface WP_REST_API_Partial_Post_Common { */ tags?: number[]; _links: WP_REST_API_Object_Links; - [k: string]: unknown; } /** * Hello. @@ -2315,7 +2314,6 @@ interface WP_REST_API_Partial_Post_Author { * The ID for the author of the post. */ author: number; - [k: string]: unknown; } /** * Properties for public post types @@ -2333,7 +2331,6 @@ interface WP_REST_API_Partial_Post_Public { * An array of the class names for the post container element. */ class_list: string[]; - [k: string]: unknown; } /** * Properties for post types that support comments @@ -2347,7 +2344,6 @@ interface WP_REST_API_Partial_Post_Comments { * Whether or not the post can be pinged. */ ping_status: WP_Post_Comment_Status_Name; - [k: string]: unknown; } /** * Properties for post types that support an excerpt @@ -2370,7 +2366,6 @@ interface WP_REST_API_Partial_Post_Excerpt { */ protected: boolean; }; - [k: string]: unknown; } /** * A media attachment object in a REST API context. diff --git a/tests/bin/build-wp-types.sh b/tests/bin/build-wp-types.sh index ac37271..68647d4 100755 --- a/tests/bin/build-wp-types.sh +++ b/tests/bin/build-wp-types.sh @@ -4,7 +4,18 @@ # -o pipefail Produce a failure return code if any command errors set -eo pipefail +for file in schemas/rest-api/partials/**/*.json +do + ./node_modules/node-jq/bin/jq --tab '. + { "additionalProperties": false }' "$file" > tmp && mv tmp "$file" +done + ./node_modules/.bin/json2ts -i schema.json -o packages/wp-types/index.ts --style.trailingComma=all --style.useTabs + +for file in schemas/rest-api/partials/**/*.json +do + ./node_modules/node-jq/bin/jq --tab 'del(.additionalProperties)' "$file" > tmp && mv tmp "$file" +done + cat packages/wp-types/append.ts >> packages/wp-types/index.ts sed -i.bak 's/export interface WP_REST_API_Partial_/interface WP_REST_API_Partial_/g' packages/wp-types/index.ts rm packages/wp-types/index.ts.bak