Extension Field Registry

x-jsonld-context - Used to associate a JSON-LD context to a schema, enabling semantic interpretation of JSON data.

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

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

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

Schema

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

Example

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