Creates a new artifact by posting the artifact content. The body of the request should
be the raw content of the artifact. This is typically in JSON format for most of the
supported types, but may be in another format for a few (for example, PROTOBUF).
The registry attempts to figure out what kind of artifact is being added from the following supported list:
- Avro (
AVRO) - Protobuf (
PROTOBUF) - JSON Schema (
JSON) - Kafka Connect (
KCONNECT) - OpenAPI (
OPENAPI) - AsyncAPI (
ASYNCAPI) - GraphQL (
GRAPHQL) - Web Services Description Language (
WSDL) - XML Schema (
XSD)
Alternatively, you can specify the artifact type using the X-Registry-ArtifactType
HTTP request header, or include a hint in the request's Content-Type. For example:
An artifact is created using the content provided in the body of the request. This
content is created under a unique artifact ID that can be provided in the request
using the X-Registry-ArtifactId request header. If not provided in the request,
the server generates a unique ID for the artifact. It is typically recommended
that callers provide the ID, because this is typically a meaningful identifier,
and for most use cases should be supplied by the caller.
If an artifact with the provided artifact ID already exists, the default behavior
is for the server to reject the content with a 409 error. However, the caller can
supply the ifExists query parameter to alter this default behavior. The ifExists
query parameter can have one of the following values:
FAIL(default) - server rejects the content with a 409 errorUPDATE- server updates the existing artifact and returns the new metadataRETURN- server does not create or add content to the server, but instead returns the metadata for the existing artifactRETURN_OR_UPDATE- server returns an existing version that matches the provided content if such a version exists, otherwise a new version is created
This operation may fail for one of the following reasons:
- An invalid
ArtifactTypewas indicated (HTTP error400) - No
ArtifactTypewas indicated and the server could not determine one from the content (HTTP error400) - Provided content (request body) was empty (HTTP error
400) - An artifact with the provided ID already exists (HTTP error
409) - The content violates one of the configured global rules (HTTP error
409) - A server error occurred (HTTP error
500)