Skip to content
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

Json schema, mark dataclass fields with default_factory as non required #122

Merged

Conversation

mishamsk
Copy link
Contributor

This adds a minimal fix to prevent marking dataclass fields with default_factory as required in the schema.

I opted to not populate the default key in the schema similar to pydantic.

Resolves #114

@Fatal1ty
Copy link
Owner

Fatal1ty commented Jul 1, 2023

Looks good, thank you!

@Fatal1ty Fatal1ty merged commit 062ee47 into Fatal1ty:master Jul 1, 2023
@mishamsk mishamsk deleted the json-schema-default-factory-support branch September 9, 2023 17:06
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.

JSON Schema generator doesn't honor default_factory
2 participants