Method: projects.locations.schemaRegistries.subjects.versions.create

Register a new version under a given subject with the given schema.

HTTP request

POST https://managedkafka.googleapis.com/v1/{parent=projects/*/locations/*/schemaRegistries/*/subjects/*}/versions

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The subject to create the version for. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schemaRegistry}/subjects/{subject} or projects/{project}/locations/{location}/schemaRegistries/{schemaRegistry}/contexts/{context}/subjects/{subject}

Request body

The request body contains data with the following structure:

JSON representation
{
  "schema": string,
  "references": [
    {
      object (SchemaReference)
    }
  ],
  "version": integer,
  "id": integer,
  "schemaType": enum (SchemaType),
  "normalize": boolean
}
Fields
schema

string

Required. The schema payload

references[]

object (SchemaReference)

Optional. The schema references used by the schema.

version

integer

Optional. The version to create. It is optional. If not specified, the version will be created with the max version ID of the subject increased by 1. If the version ID is specified, it will be used as the new version ID and must not be used by an existing version of the subject.

id

integer

Optional. The schema ID of the schema. If not specified, the schema ID will be generated by the server. If the schema ID is specified, it must not be used by an existing schema that is different from the schema to be created.

schemaType

enum (SchemaType)

Optional. The type of the schema. It is optional. If not specified, the schema type will be AVRO.

normalize

boolean

Optional. If true, the schema will be normalized before being stored. The default is false.

Response body

If successful, the response body contains a newly created instance of CreateVersionResponse.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.