toumorokoshi / jsonschema-extractor

Extract jsonschema from various Python objects
MIT License
26 stars 9 forks source link

Support attrs _InValidator #7

Closed gnir-work closed 3 years ago

gnir-work commented 3 years ago

Support attrs in validator.

The extractor will extract the options attribute from the validator and inject its value into the schema under the enum keyword.
Currently the extractor supports any attribute with the _InValidator defined, even if it doesn't have an explicit type.

I added two test cases, if you think there should be more I would love to add them, just say which tests are missing :)

Thanks for the great library :heart:

gnir-work commented 3 years ago

Hey, sorry for the late response (Had a lot of things going on lately).
I fixed you CR, mind taking a look again?

toumorokoshi commented 3 years ago

Shipped in 0.9: https://pypi.org/project/jsonschema-extractor/. Thanks!