sbrunner / jsonschema2md

Convert JSON Schemas to simple, human-readable Markdown documentation.
https://pypi.org/project/jsonschema2md/
Apache License 2.0
21 stars 12 forks source link

Add support for `pattern` for regex constrained properties. #373

Open jjrdk opened 1 week ago

jjrdk commented 1 week ago

The JSON Schema spec includes the pattern constraint for properties, but this gets ignored when generating the markdown. This PR fixes this.

The _construct_description_line function has been extended to also look for the pattern keyword and the markdown generation test has been updated to include a pattern constrained property.

sbrunner commented 1 week ago

Thanks, You just should adapt the test expected value related to your changes :-)

jjrdk commented 1 week ago

Thanks, You just should adapt the test expected value related to your changes :-)

Sorry, bad push. Fixed.

sbrunner commented 1 week ago

pre-commit isn't installed on checkout, then it steals have a little change! https://github.com/sbrunner/jsonschema2md/pull/373/checks?check_run_id=31171656143