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

Enhancement: factory from json schema #568

Open
Goldziher opened this issue Jul 21, 2024 · 2 comments
Open

Enhancement: factory from json schema #568

Goldziher opened this issue Jul 21, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@Goldziher
Copy link
Contributor

Goldziher commented Jul 21, 2024

Summary

Hiya strangers,

I work a lot with schemas these days, and its in general a pain to generate good quality values for them. Polyfactory is a great option for this.

Basic Example

from referencing.jsonschema import DRAFT202012

class MySchemaFactory(SchemaFactory[DRAFT202012]):
    __schema__ = "schemas/my_schema.yaml"

Drawbacks and Impact

None to my knowledge. Its possible not to use referencing for this, but this library is used in jsonschema as well. So I think its a good dependency.

Unresolved questions

Nope

@Goldziher Goldziher added the enhancement New feature or request label Jul 21, 2024
@Goldziher
Copy link
Contributor Author

@adhtruong hi there. any chanec of implementing this for v3? would be very nice to have this.

@adhtruong
Copy link
Collaborator

Hey @Goldziher, I'll unlikley to find time to implement myself but happy to review PRs for this!

I want to focus on v3 and given it's new functionality imagine it'll be fine to be in new base factory so should be able to be on either side of v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants