Schema Registry Rest API reference Error

Trying to upload the schema to the development env using the REST API endpoint. https://${hostName}/subjects/${schemaName}/versions`
Able to create the schemas successfully.

  1. Tested the changes with simple types, working fine. NO ISSUES
  2. Now testing the changes with some complex types. like referencing one schema in another Schama. Schema A depends on Schema B. Now created the Schema B, how to reference the schema B in schema A using rest api. any method available or something to reference in payload?
    Example below Schema A for complex types:
	{ 
     "doc": "Use this topic to publish a VINlocity order.",
	"fields": [{
			"doc": "Customer ID.",
			"name": "customer_id",
			"type": "int"
		},
		{
			"doc": "Origin Entity Address",
			"name": "origin_entity_address",
			"type": "io.example.model. avro.SchemaB"
		}
	]
}

But not sure how to reference in the REST API post call while creating the parent schema. Getting 422 status code error because complex type(Schema B) reference not provided while creating the Schema A.

I think the following page might be helpful: Schema Registry API Reference | Confluent Documentation

The example request seems to be doing something similar. If that doesn’t help, please post back here and we’ll try to get more info for you.

Thanks,
Dave

Thanks, this really helps, able to upload the schemas via KafkaJS

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.