# Schema Registry Rest API reference Error

**URL:** <https://forum.confluent.io/t/schema-registry-rest-api-reference-error/1479>\
**Category:** Schema Registry\
**Created:** [13 April 2021 21:59 UTC](https://forum.confluent.io/t/schema-registry-rest-api-reference-error/1479 "2021-04-13T21:59:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arun](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/arun/32/655_2.png) [@arun](https://forum.confluent.io/u/arun)\
**Post date:** [13 April 2021 21:59 UTC](https://forum.confluent.io/t/schema-registry-rest-api-reference-error/1479/1 "2021-04-13T21:59:37Z")

</div>

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**.

---

<div class="post-metadata">

**Author:** ![daveklein](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/daveklein/32/140_2.png) [@daveklein](https://forum.confluent.io/u/daveklein)\
**Post date:** [13 April 2021 23:23 UTC](https://forum.confluent.io/t/schema-registry-rest-api-reference-error/1479/2 "2021-04-13T23:23:23Z")

</div>

I think the following page might be helpful: [Schema Registry API Reference | Confluent Documentation](https://docs.confluent.io/platform/current/schema-registry/develop/api.html#post--subjects-(string-%20subject)-versions)

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

---

<div class="post-metadata">

**Author:** ![arun](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/arun/32/655_2.png) [@arun](https://forum.confluent.io/u/arun)\
**Post date:** [14 April 2021 21:19 UTC](https://forum.confluent.io/t/schema-registry-rest-api-reference-error/1479/5 "2021-04-14T21:19:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/1X/c49438c90c9df282e9996fdf6971be890c71b65a.svg) [@system](https://forum.confluent.io/u/system)\
**Post date:** [21 April 2021 21:19 UTC](https://forum.confluent.io/t/schema-registry-rest-api-reference-error/1479/6 "2021-04-21T21:19:33Z")

</div>

Closed on 21 April 2021 21:19 UTC

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