-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
handle default field #67
Labels
Comments
We actually won't need to #[derive(Default)]
enum Maybe<T> {
#[default]
Nothing,
Something(T),
} i.e. we just need pushing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
Some schemas can set explicit
default: replace
to define what defaults are, but we will always just output#[serde(default)]
on non-required properties.Solution
Add an
OutputImpls
struct and collect things likeimpl Default for MemberStruct
that will ensure#[serde(default)]
works and takes into account the correct default values. This is especially important for enums where no default can be derived.EDIT: This must also handle enums.
The text was updated successfully, but these errors were encountered: