-
Notifications
You must be signed in to change notification settings - Fork 25
Implement wrapUnions #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| export type Schema = RecordType | EnumType; | ||
| export interface ConversionOptions { | ||
| logicalTypes?: { [type: string]: string }; | ||
| wrapUnions?: boolean | "always" | "never" | "auto"; | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This allows boolean to match the corresponding flag in avsc, so that code that uses both avro-typescript and avsc can use the same definition of the flag. It could also use a tighter definition without the boolean: |
||
| } | ||
|
|
||
| export type Type = NameOrType | NameOrType[]; | ||
|
|
@@ -22,6 +23,7 @@ export interface BaseType { | |
| export interface RecordType extends BaseType { | ||
| type: "record"; | ||
| name: string; | ||
| namespace?: string; | ||
| fields: Field[]; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might make sense at this point to introduce a "parse context" kind of object to hold output, opts, and namespace instead of passing three variables around everywhere. I didn't do this to keep this PR focused on the new feature.