You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "rayokota (via GitHub)" <gi...@apache.org> on 2025/01/17 07:28:13 UTC

[I] Parsing Avro unions with schema references [avro-rs]

rayokota opened a new issue, #103:
URL: https://github.com/apache/avro-rs/issues/103

   The docs state that the `Schema::parse_list` can parse a set of schemas that depend on one another,  but all schemas in the set need to be named.
   
   How would I parse a set of schemas where one schema is a union that depends on other named schemas such as the following?
   
   ```
           let union = "['myschema1', 'myschema2']";
   
           let myschema1 = r#"
           {
               'type': 'record',
               'name': 'myschema1',
               'fields': [ {'name': 'name', 'type': 'string'} ]
           }
           "#;
   
           let myschema2 = r#"
           {
               'type': 'record',
               'name': 'myschema2',
               'fields': [ {'name': 'age', 'type': 'int'} ]
           }
           "#;
   ```
   
   It seems the  `Schema::parse_with_names(value: &Value, names: Names)` method would work for this use case, but it is not currently public.  Would it be possible to make that method public?
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org.apache.org

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


Re: [I] Parsing Avro unions with schema references [avro-rs]

Posted by "rayokota (via GitHub)" <gi...@apache.org>.
rayokota commented on issue #103:
URL: https://github.com/apache/avro-rs/issues/103#issuecomment-2599585923

   Thanks @martin-g , I added a new method `Schema:: parse_str_with_list` that can be used to parse a root schema with a list of named schemas.   https://github.com/apache/avro-rs/pulls


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

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


Re: [I] Parsing Avro unions with schema references [avro-rs]

Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g closed issue #103: Parsing Avro unions with schema references
URL: https://github.com/apache/avro-rs/issues/103


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

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


Re: [I] Parsing Avro unions with schema references [avro-rs]

Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g commented on issue #103:
URL: https://github.com/apache/avro-rs/issues/103#issuecomment-2597620125

   Please send a Pull Request with this snippet as a test case and making the method public!


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

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