confluentinc / confluentinc/schema-registry
API documentation for new schema registration with references is misleading
- Dominant language
- Java
- Stars
- 2.5k
- Forks
- 1.2k
- Avg merge
- 23h 27m
- Merged PRs (30d)
- 65
Description
Request example given for the schema registration api in [documentation](https://docs.confluent.io/current/schema-registry/develop/api.html#schemaregistry-api) contains avro field names with (.) dots. According to the [avro specification](https://avro.apache.org/docs/current/spec.html#names) it's not possible.
```bash
POST /subjects/test/versions HTTP/1.1
Host: schemaregistry.example.com
Accept: application/vnd.schemaregistry.v1+json, application/vnd.schemaregistry+json, application/json
{
"schema":
"{
\"type\": \"record\",
\"name\": \"test\",
\"fields\":
[
{
\"type\": \"string\",
\"name\": \"field1\"
},
{
\"type\": \"int\",
\"name\": \"com.acme.Referenced\"
}
]
}",
"schemaType": "AVRO",
"references": [
{
"name": "com.acme.Referenced",
"subject": "childSubject",
"version": 1
}
]
}
```
This will throw `org.apache.avro.SchemaParseException: Illegal character in: com.acme.Referenced`
Since I couldn't find any proper/complete/working samples on how to use schema references with avro unions (besides [this](https://www.confluent.io/blog/multiple-event-types-in-the-same-kafka-topic/)), I thought it would be nice to address this part of the documenation.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.