From f4de19abd2d50c5d9acc8d963fb6006a0dc0e024 Mon Sep 17 00:00:00 2001 From: Roberto Polli Date: Wed, 3 Dec 2025 18:15:30 +0100 Subject: [PATCH 1/4] Fix: #37. x-jsonld keywords. --- registries/_extension/x-jsonld-context.md | 54 +++++++++++++++++++++++ registries/_extension/x-jsonld-type.md | 50 +++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 registries/_extension/x-jsonld-context.md create mode 100644 registries/_extension/x-jsonld-type.md diff --git a/registries/_extension/x-jsonld-context.md b/registries/_extension/x-jsonld-context.md new file mode 100644 index 0000000..5e945da --- /dev/null +++ b/registries/_extension/x-jsonld-context.md @@ -0,0 +1,54 @@ +--- +owner: ioggstream +issue: +description: Used to associate a JSON-LD context to a schema, enabling semantic interpretation of JSON data. +schema: + oneOf: + - type: string + format: uri + - type: object + - type: array + items: + oneOf: + - type: string + format: uri + - type: object +objects: [ "schemaObject" ] +layout: default +--- + +{% capture summary %} +The `x-jsonld-context` extension is used to associate a JSON-LD `@context` to a schema, enabling semantic interpretation of JSON data by mapping terms to IRIs and defining the vocabulary. It can appear as a property in the following objects: `{{page.objects|jsonify}}`. + +It can be used in conjunction with `x-jsonld-type`. + +This extension is defined in [draft-polli-restapi-ld-keywords](https://datatracker.ietf.org/doc/draft-polli-restapi-ld-keywords/) and is based on the [JSON-LD 1.1](https://www.w3.org/TR/json-ld11/#interpreting-json-as-json-ld) specification. +{% endcapture %} + +{% capture example %} +```yaml +openapi: 3.0.0 +... +components: + schemas: + Person: + "x-jsonld-context": + "@vocab": "https://schema.org/" + type: object + properties: + familyName: { type: string, maxLength: 255 } + givenName: { type: string, maxLength: 255 } + example: + familyName: "Doe" + givenName: "John" +``` + +Used by: (informational) + +* Italian Agencies +* https://schema.gov.it +* https://api.gov.it +{% endcapture %} + +{% include extension-entry.md summary=summary example=example %} + diff --git a/registries/_extension/x-jsonld-type.md b/registries/_extension/x-jsonld-type.md new file mode 100644 index 0000000..b2e826e --- /dev/null +++ b/registries/_extension/x-jsonld-type.md @@ -0,0 +1,50 @@ +--- +owner: ioggstream +issue: +description: Used to associate a JSON-LD type to a schema, enabling semantic interoperability. +schema: + oneOf: + - type: string + - type: array + items: + type: string +objects: [ "schemaObject" ] +layout: default +--- + +{% capture summary %} +The `x-jsonld-type` extension is used to associate a JSON-LD `@type` to a schema, enabling semantic interoperability by specifying the type of the resource in terms of ontologies and vocabularies. It can appear as a property in the following objects: `{{page.objects|jsonify}}`. + +It can be used in conjunction with `x-jsonld-context`. + +This extension is defined in [draft-polli-restapi-ld-keywords](https://datatracker.ietf.org/doc/draft-polli-restapi-ld-keywords/) and is based on the [JSON-LD 1.1](https://www.w3.org/TR/json-ld11/#interpreting-json-as-json-ld) specification. +{% endcapture %} + +{% capture example %} +```yaml +openapi: 3.0.0 +... +components: + schemas: + Person: + "x-jsonld-type": "https://schema.org/Person" + "x-jsonld-context": + "@vocab": "https://schema.org/" + type: object + properties: + familyName: { type: string, maxLength: 255 } + givenName: { type: string, maxLength: 255 } + example: + familyName: "Doe" + givenName: "John" +``` + +Used by: + +* Italian Agencies +* https://schema.gov.it +* https://api.gov.it +{% endcapture %} + +{% include extension-entry.md summary=summary example=example %} + From 4e847890b83fc68492c3a978a5709640f3e796de Mon Sep 17 00:00:00 2001 From: Roberto Polli Date: Thu, 4 Dec 2025 13:48:40 +0100 Subject: [PATCH 2/4] Update registries/_extension/x-jsonld-context.md --- registries/_extension/x-jsonld-context.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registries/_extension/x-jsonld-context.md b/registries/_extension/x-jsonld-context.md index 5e945da..0c6f1a6 100644 --- a/registries/_extension/x-jsonld-context.md +++ b/registries/_extension/x-jsonld-context.md @@ -27,7 +27,7 @@ This extension is defined in [draft-polli-restapi-ld-keywords](https://datatrack {% capture example %} ```yaml -openapi: 3.0.0 +openapi: 3.2.0 ... components: schemas: From fff1ec0cdcc869b1fd20eb18c747cfe205a598fe Mon Sep 17 00:00:00 2001 From: Roberto Polli Date: Thu, 4 Dec 2025 13:49:05 +0100 Subject: [PATCH 3/4] Karen's review --- registries/_extension/x-jsonld-type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registries/_extension/x-jsonld-type.md b/registries/_extension/x-jsonld-type.md index b2e826e..a7ad802 100644 --- a/registries/_extension/x-jsonld-type.md +++ b/registries/_extension/x-jsonld-type.md @@ -22,7 +22,7 @@ This extension is defined in [draft-polli-restapi-ld-keywords](https://datatrack {% capture example %} ```yaml -openapi: 3.0.0 +openapi: 3.2.0 ... components: schemas: From eaa768121febf831556566c67ec76348190a16ba Mon Sep 17 00:00:00 2001 From: Roberto Polli Date: Thu, 4 Dec 2025 13:50:20 +0100 Subject: [PATCH 4/4] Apply suggestion from @ioggstream --- registries/_extension/x-jsonld-type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registries/_extension/x-jsonld-type.md b/registries/_extension/x-jsonld-type.md index a7ad802..4ae825b 100644 --- a/registries/_extension/x-jsonld-type.md +++ b/registries/_extension/x-jsonld-type.md @@ -39,7 +39,7 @@ components: givenName: "John" ``` -Used by: +Used by: (informational) * Italian Agencies * https://schema.gov.it