[
https://issues.apache.org/jira/browse/AVRO-4243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated AVRO-4243:
---------------------------------
Labels: pull-request-available (was: )
> Specification is vague about what type strings are allowed in JSON schema's
> "type" field
> ----------------------------------------------------------------------------------------
>
> Key: AVRO-4243
> URL: https://issues.apache.org/jira/browse/AVRO-4243
> Project: Apache Avro
> Issue Type: Bug
> Components: spec
> Affects Versions: 1.12.1
> Reporter: Kit Danison-Fieldhouse
> Priority: Blocker
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Hi all, the current hosted version of the [specification
> |https://avro.apache.org/docs/++version++/specification/]says the following
> about allowable schema:
> {quote}Schema Declaration
> A Schema is represented in JSON by one of:
> - A JSON string, naming a defined type.
> - A JSON object, of the form:
> Unknown macro: \{"type"}
> where typeName is either a primitive or derived type name, as defined below.
> Attributes not defined in this document are permitted as metadata, but must
> not affect the format of serialized data.
> - A JSON array, representing a union of embedded types.{quote}
> What is vague is the use of the term "derived type name". In this version of
> the specification, the only other mention of "derived" is on the section on
> Logical Types and is not related to its use here.
> What is unclear to me is if this should mean "primitive or complex built-in
> type names" or should mean "primitive or complex built-in type names as well
> as user defined type names". If its the second case, what should the
> specified behavior be if the JSON schema includes extra attributes or
> redefines attributes? For instance, in this case, what should we do if we
> have the schemata:
> {code:json}
> {
> "type": "enum",
> "name": "someEnum",
> "symbols": ["A", "B", "C"]
> }
> {
> "type": "someEnum",
> "name": "someEnumAgain",
> "symbols": ["A", "D", "E"],
> "someMetaData" : "helloWorld"
> }
> {code}
> In this case we are referencing "someEnum" but then also appear to give it a
> new name, redefine its symbols, and add some metadata into the schema. I
> don't think it is obvious what the behavior should be in this case.
>
> I think the sensible interpretation of this sentence is that "derived type"
> means "complex built-in type names" to avoid having to deal with the issues
> mentioned above.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)