Extension Field Registry

x-jsonld-type - Used to associate a JSON-LD type to a schema, enabling semantic interoperability.

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: ["schemaObject"].

It can be used in conjunction with x-jsonld-context.

This extension is defined in draft-polli-restapi-ld-keywords and is based on the JSON-LD 1.1 specification.

Schema

{"oneOf"=>[{"type"=>"string"}, {"type"=>"array", "items"=>{"type"=>"string"}}]}

Example

openapi: 3.2.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: (informational)

  • Italian Agencies
  • https://schema.gov.it
  • https://api.gov.it