Closed SolidTux closed 1 year ago
This is a proof of concept to use the description field of properties to generate doc comments when using the python serializer.
Is this a good idea? In general it would be great to have some way of generating doc comments and the description seems appropriate. But especially with object properties this is a bit weird as it uses the same string for the documentation of the property and the class.
@SolidTux Thanks for submitting, this is definitely desirable. I'll aim to review in more depth today.
@SolidTux as an aside, I'd be interested if you could share your output of make test
on master
.
If the error relates to a missing file, please ensure you have followed the development set-up instructions, in particular:
git submodule update --init --recursive
@SolidTux Thanks again for submitting. I've proposed a few changes to the intended behaviour, but implementation otherwise looks good.
test_that_main_produces_expected_output fails on a few cases where the schema under test contains descriptions. This test just runs code generation on each of the schemas in tests/jsonschemas/ and compares the resulting ASTs to the corresponding files in tests/models/.
Resolving these should be as simple as updating the files in tests/models/ to include the appropriate docstrings and description fields.
Thank you a lot for the fast review and answer! I will have a look after the weekend.
Use description field to generate doc comments
Check list
Before asking for a review
master
make test
passes locally. ~(many don't pass, but they also don't without my changes)~[Unreleased]
section in CHANGELOG.md is updated.Before review (reviewer)
After merge (reviewer)