{ "swagger": "2.0", "info": { "title": "Azure Schema Registry", "version": "2023-07-01", "description": "SchemaRegistryClient is a client for registering and retrieving schemas from the Azure Schema Registry service.", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "x-ms-parameterized-host": { "hostTemplate": "https://{fullyQualifiedNamespace}", "useSchemePrefix": false, "parameters": [ { "name": "fullyQualifiedNamespace", "in": "path", "description": "The Schema Registry service endpoint, for example 'my-namespace.servicebus.windows.net'.", "required": true, "type": "string" } ] }, "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "OAuth2Auth": [ "https://eventhubs.azure.net/.default" ] } ], "securityDefinitions": { "OAuth2Auth": { "type": "oauth2", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "https://eventhubs.azure.net/.default": "" } } }, "tags": [], "paths": { "/$schemaGroups": { "get": { "operationId": "ListSchemaGroups", "summary": "Get list of schema groups.", "description": "Gets the list of schema groups user is authorized to access.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/SchemaGroups" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "List Schema Groups": { "$ref": "./examples/ListSchemaGroups.json" } }, "x-ms-pageable": { "nextLinkName": "NextLink", "itemName": "Value" } } }, "/$schemaGroups/{groupName}/schemas/{schemaName}:get-id": { "post": { "operationId": "GetSchemaPropertiesByContent", "summary": "Get properties for existing schema.", "description": "Gets the properties referencing an existing schema within the specified schema group, as matched by schema content comparison.", "consumes": [ "application/json; serialization=Avro", "application/json; serialization=Json", "text/plain; charset=utf-8", "text/vnd.ms.protobuf" ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "groupName", "in": "path", "description": "Name of schema group.", "required": true, "type": "string" }, { "name": "schemaName", "in": "path", "description": "Name of schema.", "required": true, "type": "string", "maxLength": 50, "pattern": "^[A-Za-z0-9][^\\\\/$:]*$" }, { "name": "schemaContent", "in": "body", "description": "String representation (UTF-8) of the schema.", "required": true, "schema": { "type": "string", "format": "binary" } } ], "responses": { "204": { "description": "There is no content to send for this request, but the headers may be useful. ", "headers": { "Location": { "type": "string", "description": "URL location of schema, identified by schema group, schema name, and version." }, "Schema-Group-Name": { "type": "string", "description": "References schema group." }, "Schema-Id": { "type": "string", "description": "References specific schema in registry namespace." }, "Schema-Id-Location": { "type": "string", "description": "URL location of schema, identified by schema ID." }, "Schema-Name": { "type": "string", "description": "References schema name." }, "Schema-Version": { "type": "integer", "format": "int32", "description": "Version of the returned schema." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Get Schema Properties By Content": { "$ref": "./examples/GetSchemaPropertiesByContent.json" } } } }, "/$schemaGroups/{groupName}/schemas/{schemaName}": { "put": { "operationId": "RegisterSchema", "summary": "Register new schema", "description": "Register new schema. If schema of specified name does not exist in specified group, schema is created at version 1. If schema of specified name exists already in specified group, schema is created at latest version + 1.", "consumes": [ "application/json; serialization=Avro", "application/json; serialization=Json", "text/plain; charset=utf-8", "text/vnd.ms.protobuf" ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "groupName", "in": "path", "description": "Name of schema group.", "required": true, "type": "string" }, { "name": "schemaName", "in": "path", "description": "Name of schema.", "required": true, "type": "string", "maxLength": 50, "pattern": "^[A-Za-z0-9][^\\\\/$:]*$" }, { "name": "schemaContent", "in": "body", "description": "String representation (UTF-8) of the schema.", "required": true, "schema": { "type": "string", "format": "binary" } } ], "responses": { "204": { "description": "There is no content to send for this request, but the headers may be useful. ", "headers": { "Location": { "type": "string", "description": "URL location of schema, identified by schema group, schema name, and version." }, "Schema-Group-Name": { "type": "string", "description": "References schema group." }, "Schema-Id": { "type": "string", "description": "References specific schema in registry namespace." }, "Schema-Id-Location": { "type": "string", "description": "URL location of schema, identified by schema ID." }, "Schema-Name": { "type": "string", "description": "References schema name." }, "Schema-Version": { "type": "integer", "format": "int32", "description": "Version of the returned schema." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Register Schema": { "$ref": "./examples/RegisterSchema.json" } } } }, "/$schemaGroups/{groupName}/schemas/{schemaName}/versions": { "get": { "operationId": "ListSchemaVersions", "summary": "List schema versions.", "description": "Gets the list of all versions of one schema.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "groupName", "in": "path", "description": "Name of schema group.", "required": true, "type": "string" }, { "name": "schemaName", "in": "path", "description": "Name of schema.", "required": true, "type": "string", "maxLength": 50, "pattern": "^[A-Za-z0-9][^\\\\/$:]*$" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/SchemaVersions" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "List Schema Versions": { "$ref": "./examples/ListSchemaVersions.json" } }, "x-ms-pageable": { "nextLinkName": "NextLink", "itemName": "Value" } } }, "/$schemaGroups/{groupName}/schemas/{schemaName}/versions/{schemaVersion}": { "get": { "operationId": "GetSchemaByVersion", "summary": "Get specific schema versions.", "description": "Gets one specific version of one schema.", "produces": [ "application/json; serialization=Avro", "application/json; serialization=Json", "text/plain; charset=utf-8", "text/vnd.ms.protobuf", "application/json" ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "groupName", "in": "path", "description": "Name of schema group.", "required": true, "type": "string" }, { "name": "schemaName", "in": "path", "description": "Name of schema.", "required": true, "type": "string", "maxLength": 50, "pattern": "^[A-Za-z0-9][^\\\\/$:]*$" }, { "name": "schemaVersion", "in": "path", "description": "Version number of specific schema.", "required": true, "type": "integer", "format": "int32" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "type": "file" }, "headers": { "Location": { "type": "string", "description": "URL location of schema, identified by schema group, schema name, and version." }, "Schema-Group-Name": { "type": "string", "description": "References schema group." }, "Schema-Id": { "type": "string", "description": "References specific schema in registry namespace." }, "Schema-Id-Location": { "type": "string", "description": "URL location of schema, identified by schema ID." }, "Schema-Name": { "type": "string", "description": "References schema name." }, "Schema-Version": { "type": "integer", "format": "int32", "description": "Version of the returned schema." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Get Schema by Version": { "$ref": "./examples/GetSchemaByVersion.json" } } } }, "/$schemaGroups/$schemas/{id}": { "get": { "operationId": "GetSchemaById", "summary": "Get a registered schema by its unique ID reference.", "description": "Gets a registered schema by its unique ID. Azure Schema Registry guarantees that ID is unique within a namespace. Operation response type is based on serialization of schema requested.", "produces": [ "application/json; serialization=Avro", "application/json; serialization=Json", "text/plain; charset=utf-8", "text/vnd.ms.protobuf", "application/json" ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "id", "in": "path", "description": "Schema ID that uniquely identifies a schema in the registry namespace.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "type": "file" }, "headers": { "Location": { "type": "string", "description": "URL location of schema, identified by schema group, schema name, and version." }, "Schema-Group-Name": { "type": "string", "description": "References schema group." }, "Schema-Id": { "type": "string", "description": "References specific schema in registry namespace." }, "Schema-Id-Location": { "type": "string", "description": "URL location of schema, identified by schema ID." }, "Schema-Name": { "type": "string", "description": "References schema name." }, "Schema-Version": { "type": "integer", "format": "int32", "description": "Version of the returned schema." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Get Schema by ID": { "$ref": "./examples/GetSchemaById.json" } } } } }, "definitions": { "Azure.Core.Foundations.Error": { "type": "object", "description": "The error object.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error." }, "details": { "type": "array", "description": "An array of details about specific errors that led to this reported error.", "items": { "$ref": "#/definitions/Azure.Core.Foundations.Error" } }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "An object containing more specific information than the current object about the error." } }, "required": [ "code", "message" ] }, "Azure.Core.Foundations.ErrorResponse": { "type": "object", "description": "A response containing error details.", "properties": { "error": { "$ref": "#/definitions/Azure.Core.Foundations.Error", "description": "The error object." } }, "required": [ "error" ] }, "Azure.Core.Foundations.InnerError": { "type": "object", "description": "An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "Inner error." } } }, "Schema": { "type": "object", "description": "The schema, including its metadata and content.", "properties": { "schemaContent": { "type": "string", "format": "byte", "description": "String representation (UTF-8) of the schema." } }, "required": [ "schemaContent" ] }, "SchemaContentTypeValues": { "type": "string", "description": "Describes closed list of schema content type values.", "enum": [ "application/json; serialization=Avro", "application/json; serialization=Json", "text/plain; charset=utf-8", "text/vnd.ms.protobuf" ], "x-ms-enum": { "name": "SchemaContentTypeValues", "modelAsString": false, "values": [ { "name": "avro", "value": "application/json; serialization=Avro", "description": "Avro encoding." }, { "name": "json", "value": "application/json; serialization=Json", "description": "JSON encoding" }, { "name": "custom", "value": "text/plain; charset=utf-8", "description": "Plain text custom encoding." }, { "name": "protobuf", "value": "text/vnd.ms.protobuf", "description": "Protobuf encoding." } ] } }, "SchemaGroup": { "type": "object", "description": "Schema Group resource.", "properties": { "groupName": { "type": "string", "description": "Name of schema group.", "readOnly": true } }, "required": [ "groupName" ] }, "SchemaGroups": { "type": "object", "description": "The list of schema group names with server paging support.", "properties": { "Value": { "type": "array", "description": "The collection of pageable schema group name items.", "items": { "type": "string" } }, "NextLink": { "type": "string", "format": "uri", "description": "The link to the next page of items" } }, "required": [ "Value" ] }, "SchemaProperties": { "type": "object", "description": "Metadata of a schema." }, "SchemaVersions": { "type": "object", "description": "The list of schema versions with server paging support.", "properties": { "Value": { "type": "array", "description": "The collection of schema version pageable items.", "items": { "type": "integer", "format": "int32" } }, "NextLink": { "type": "string", "format": "uri", "description": "The link to the next page of items" } }, "required": [ "Value" ] }, "SchemasName": { "type": "object", "description": "Schemas resource.", "properties": { "schemaName": { "type": "string", "description": "Name of schema.", "maxLength": 50, "pattern": "^[A-Za-z0-9][^\\\\/$:]*$", "readOnly": true } }, "required": [ "schemaName" ] } }, "parameters": { "Azure.Core.Foundations.ApiVersionParameter": { "name": "api-version", "in": "query", "description": "The API version to use for this operation.", "required": true, "type": "string", "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" } } }