Skip to content

Minor enhancement to parse_str_with_list - #105

Merged
martin-g merged 2 commits into
apache:mainfrom
rayokota:enhance-parse-root
Jan 18, 2025
Merged

martin-g merged 2 commits into
apache:mainfrom
rayokota:enhance-parse-root

Conversation

@rayokota

@rayokota rayokota commented Jan 18, 2025 •

Copy link
Copy Markdown
Contributor

A minor enhancement to parse_str_with_list to return the parsed named schemata. This is to make it easier to use with to_avro_datum_schemata and from_avro_datum_schemata, both of which take a root schema and a Vector of named schemas.

This is a follow-on PR to #104

A minor enhancement to `parse_str_with_list` to return
the parsed named schemata.  This is to make it easier
to use with `to_avro_datum_schemata` and `from_avro_datum_schemata`,
both of which take a root schema and a Vector of named schemas.
Comment thread avro/src/schema.rs
let (schema_c, schemata) =
Schema::parse_str_with_list(schema_str_c, &[schema_str_a, schema_str_b])?;

let schema_a_expected = Schema::Record(RecordSchema {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be a good idea to start using a builder for the non-primitive schema types and RecordFiled. There are many fields which have good defaults which could be omitted here.
I'll file an issue!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martin-g
martin-g merged commit 4411f75 into apache:main Jan 18, 2025
@martin-g

Copy link
Copy Markdown
Member

Thank you, @rayokota !

@rayokota

Copy link
Copy Markdown
Contributor Author

Thanks @martin-g for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants