# Schema Registry: Error when registering schema with references

**URL:** <https://forum.confluent.io/t/schema-registry-error-when-registering-schema-with-references/11297>\
**Category:** Schema Registry\
**Created:** [22 August 2024 18:43 UTC](https://forum.confluent.io/t/schema-registry-error-when-registering-schema-with-references/11297 "2024-08-22T18:43:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianshih1](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/brianshih1/32/3960_2.png) [@brianshih1](https://forum.confluent.io/u/brianshih1)\
**Post date:** [22 August 2024 18:43 UTC](https://forum.confluent.io/t/schema-registry-error-when-registering-schema-with-references/11297/1 "2024-08-22T18:43:34Z")

</div>

I am following the example provided in the document about registering schemas with references: [Schema Registry API Reference | Confluent Documentation](https://docs.confluent.io/platform/current/schema-registry/develop/api.html#post--subjects-(string-%20subject)-versions)

First, I register a string schema under the subject `hello`:

```auto
curl -X POST "http://localhost:8087/subjects/hello/versions" \
     -H "Content-Type: application/json" \
     -d '{ "schema": "{\"type\":\"string\"}"}’
}'

```

Next, I register the following schema alongside the references:

```auto
curl -X POST "http://localhost:8087/subjects/foo/versions" \
     -H "Content-Type: application/json" \
     -d '{
       "schema": "{\"type\":\"record\",\"name\":\"test\",\"fields\":[{\"name\":\"f1\",\"type\":\"string\"},{\"name\":\"f2\",\"type\":\"com.acme.Referenced\"}]}",
       "references": [
         {
           "name": "com.acme.Referenced",
           "subject": "hello",
           "version": 1
         }
       ]
     }'

```

However, I get the following error: `"com.acme.Referenced\" is not a defined name. The type of the \"f2\" field must be a defined name or a {\"type\": ...} expression."}`.

Any chance anyone know what is the cause of this error?
