You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by GitBox <gi...@apache.org> on 2020/04/29 15:07:25 UTC

[GitHub] [avro] rayokota edited a comment on pull request #869: AVRO-2822: Add toString that doesn't inline referenced schemas

rayokota edited a comment on pull request #869:
URL: https://github.com/apache/avro/pull/869#issuecomment-621271223


   @RyanSkraba , yes, it is to be able to write nested schemas only by name, instead of inlining them.   Currently in https://github.com/confluentinc/schema-registry/issues/1432 I am having to place my code in the `org.apache.avro` package because this functionality is available, but is package-private.
   
   The motivation behind this is that with Schema Registry, we have a very large customer who wants to be able to evolve and version nested schemas independent of the root schema.  In order to do this, the latest versions of nested schemas will be added to the `Parser` dynamically.  So the root schema should not contain the inline nested schemas, but only refer to them by name.
   
   Below is an example of output of this method, given nested or referenced schemas with name `acme.Product`.  Note that only the name is generated rather than the `acme.Product` schema being generated inline.
   
   ```
   {
    "type": "record",
    "namespace": "acme",
    "name": "order",
    "fields": [
        {"name": "order_id", "type": "string"},
        {"name": "order_date", "type": "string"},
        {
           "name": "product",
           "type": "acme.product"
        }
    ]
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org