Enhancement: factory from json schema
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
@adhtruong hi there. any chanec of implementing this for v3? would be very nice to have this.
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
I am ready to implement this task.