Create Definitions
CreateDefinitions creates one-many new Definitions for the specified ConnectorVersion. For simple cases, it’s recommended to create Definitions individually, however this endpoint can be used to create multiple Definitions for cases where one Definition references another.
Definitions with cyclic references can be created in one API call, see the documentation for the
DefinitionCreate
schema for more info.
Authorizations
Bearer token authentication used by the Versori Platform. External consumers must provide an API key, however internal consumers must provide a JWT id_token issued by our IdP.
Path Parameters
ID is the unique identifier of the Connector.
Version is the version name of the Connector to retrieve. The reserved names "latest" and "default" may be used to retrieve the latest version or the default version respectively.
Body
DefinitionsCreate is the payload used to create new Definitions. Each definition can reference another definition in the same request using the following syntax:
{
"$ref": "#/$defs/{definition_name}"
}
New definitions may also reference existing definitions, however they use the proper URL syntax:
{
"$ref": "https://platform.versori.com/api/schemas/v1/o/{organisation_id}/{connector_id}/{connector_version}/{definition_id}.{media_type_ext}"
}
Note, the $refs stored in GCS are the
gs://
URLs. The API must transform the URLs to the correct public URL. Ideally, the Definition'sname
would be in the URL, but this would cause issues if a user wanted to rename a Definition, which is something I think we should support. For now usingid
is fine, but if we changed to in the future, we'd need a way to iterate over all Definitions referencing the one being renamed and update the $ref URLs.
For referencing existing definitions, the definition name must already exist within the scope of the current Connector and Version.
Each definition must have matching dataMediaTypes
and schema.mediaType
values.
Name is a unique identifier for the Definition within the scope of the Connector. It is expected to both human and machine-readable, i.e. "Product" or "product_variant".
Accept indicates which content types, expressed as MIME types, that this definition can accept. This value is analogous to the Accept HTTP header, as defined in RFC 7231, section 5.3.2, except each type is defined in a separate array element, rather than as a comma-separated list.
This does not represent the content type of the schema body itself, but the data which conforms to this
definition. For example, an API may respond in JSON or YAML, but the schema may be a YAML-formatted JSON
Schema. In this case, the Definition's accept
field could be ["application/json", "text/yaml"]
and
schema.contentType
will be application/schema+yaml
.
Description is a human-friendly description of the Definition. This is typically used to describe the purpose of the Definition and how it should be used.
InlineSchema is a Schema which is defined inline within the Definition. This is typically used when creating or updating a Definition and the actual schema payload is sent with the request. For retrieval operations, the Definition will contain a URL which resolves to the Schema.
Response
Definitions is a list of Definition objects. This is a non-paginated list and contains all definitions related to the originating request (i.e. all created Definitions in a CreateDefinitions request).
ID is the unique identifier of the Definition.
Name is a unique identifier for the Definition within the scope of the Connector. It is expected to both human and machine-readable, i.e. "Product" or "product_variant".
Accept indicates which content types, expressed as MIME types, that this definition can accept. This value is analogous to the Accept HTTP header, as defined in RFC 7231, section 5.3.2, except each type is defined in a separate array element, rather than as a comma-separated list.
This does not represent the content type of the schema body itself, but the data which conforms to this
definition. For example, an API may respond in JSON or YAML, but the schema may be a YAML-formatted JSON
Schema. In this case, the Definition's accept
field could be ["application/json", "text/yaml"]
and
schema.contentType
will be application/schema+yaml
.
Description is a human-friendly description of the Definition. This is typically used to describe the purpose of the Definition and how it should be used.
URL is the location of the actual Schema definition for this Definition entity.
The structure of this URL will be consistent across all media types for each connection, for example:
https://platform.versori.com/api/schemas/v1/o/{organisation_id}/{connector_id}/{connector_version}/{definition_slug}.{media_type_ext}
ReferencedBy is a list of DefinitionReference objects which defines what other entities are referencing the this Definition.