avro-schema-registry icon indicating copy to clipboard operation
avro-schema-registry copied to clipboard

Subject name cannot start with a number (does not conform with Confluent SR).

Open mikalaisyty opened this issue 6 years ago • 2 comments

When I register a new schema under the subject which name starts with a number, I get 404 response.

Request:

POST https://avro-schema-registry.salsify.com/subjects/1startswithnumber/versions
Content-Type: application/json
Authorization: Basic YXZybzphdnJv
{
  "schema": "{\"type\":\"string\"}"
}

Response: 404 Not Found

With the subject starting with character, it works:

Request:

POST https://avro-schema-registry.salsify.com/subjects/startswithcharacter/versions
Content-Type: application/json
Authorization: Basic YXZybzphdnJv
{
  "schema": "{\"type\":\"string\"}"
}

Response:

{
    "id": 2
}

In comparison, Confluent Schema Registry accepts subjects with names starting with numbers.

mikalaisyty avatar Feb 19 '19 12:02 mikalaisyty

The convention we were using when we developed this registry was to register schemas with the name of the Avro schema, and Avro schema names cannot begin with digits.

I don't think that it would be problematic to change this, but that is the context for the current behavior.

tjwp avatar Feb 19 '19 12:02 tjwp

Hm.. good point, I did not think about it. What do you think about changing the current behavior? I feel like there are two ways:

  1. Add docs about this particular difference to Confluent way and add error handling propagating explanatory error message and code,
  2. Changing the behavior.

I am very-very new to Ruby, but I would like to contribute.

mikalaisyty avatar Feb 19 '19 13:02 mikalaisyty