You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Greg Hale (JIRA)" <ji...@apache.org> on 2018/12/19 22:09:00 UTC
[jira] [Updated] (AVRO-2287) Ambiguous documentation around JSON
encoding and names
[ https://issues.apache.org/jira/browse/AVRO-2287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Greg Hale updated AVRO-2287:
----------------------------
Description:
{noformat}
otherwise it is encoded as a JSON object with one name/value pair whose name is the type's name and whose value is the recursively encoded value. For Avro's named types (record, fixed or enum) the user-specified name is used, for other types the type name is used.{noformat}
This quote from the [documentation|http://avro.apache.org/docs/current/spec.html#json_encoding] ([source|https://github.com/apache/avro/blob/c011d76436a1c11c614a133ae06abbc19baf2436/doc/src/content/xdocs/spec.xml#L574]) leaves me with some questions about which names are allowed to be used in the encoded JSON.
For example -
* If we are decoding a union value in JSON using its type name as a tag, do we need to use the type's _fullname_ (some.namespace.Foo), or can we use the unqualified name, Foo?
* Does the answer change if Foo does not have an explicit namespace in the schema?
* What should happen if the union's schema includes two types that differ only in namespace (namespace1.Foo vs. namespace2.Foo )?
* Are there different rules for the null namespace?
was:
{noformat}
otherwise it is encoded as a JSON object with one name/value pair whose name is the type's name and whose value is the recursively encoded value. For Avro's named types (record, fixed or enum) the user-specified name is used, for other types the type name is used.{noformat}
This quote from the [documentation|http://avro.apache.org/docs/current/spec.html#json_encoding] ([source|https://github.com/apache/avro/blob/c011d76436a1c11c614a133ae06abbc19baf2436/doc/src/content/xdocs/spec.xml#L574]) doesn't make it clear which names are allowed to be used in the encoded JSON.
For instance, if we are decoding a union value in JSON using its type name as a tag, do we need to use the type's _fullname_ (some.namespace.Foo), or can we use the unqualified name, Foo? Does the answer change if Foo does not have an explicit namespace in the schema? What should happen if the union's schema includes two types that differ only in namespace (namespace1.Foo vs. namespace2.Foo )?
> Ambiguous documentation around JSON encoding and names
> ------------------------------------------------------
>
> Key: AVRO-2287
> URL: https://issues.apache.org/jira/browse/AVRO-2287
> Project: Apache Avro
> Issue Type: Bug
> Components: doc
> Reporter: Greg Hale
> Priority: Minor
>
> {noformat}
> otherwise it is encoded as a JSON object with one name/value pair whose name is the type's name and whose value is the recursively encoded value. For Avro's named types (record, fixed or enum) the user-specified name is used, for other types the type name is used.{noformat}
> This quote from the [documentation|http://avro.apache.org/docs/current/spec.html#json_encoding] ([source|https://github.com/apache/avro/blob/c011d76436a1c11c614a133ae06abbc19baf2436/doc/src/content/xdocs/spec.xml#L574]) leaves me with some questions about which names are allowed to be used in the encoded JSON.
> For example -
> * If we are decoding a union value in JSON using its type name as a tag, do we need to use the type's _fullname_ (some.namespace.Foo), or can we use the unqualified name, Foo?
> * Does the answer change if Foo does not have an explicit namespace in the schema?
> * What should happen if the union's schema includes two types that differ only in namespace (namespace1.Foo vs. namespace2.Foo )?
> * Are there different rules for the null namespace?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)