Represent conditional properties in the properties table#73
Represent conditional properties in the properties table#73shwethanidd wants to merge 3 commits into
Conversation
…rties with gear icon under a new column 'conditional required' column. Added sufficient comments in the script on how the individual .md files are created.
mvgeorgescu
left a comment
There was a problem hiding this comment.
The added comments help describe what individual lines are doing, but many of them restate the code rather than explaining the progression. For this script, I think the useful comments should explain the pipeline:
schema file(s) → md file generation -> conversion to html
Right now, it is still hard to follow. It's not clear how conditional requirements get from the schema into the generated table.
I would add a module-level flow description at the top of the file.
|
|
||
| def add_table_of_properties(contents: dict, md_file: MdUtils): | ||
| list_of_strings = ["Property", "Type", "Required", "Format", "Title"] | ||
| def collect_conditional_requirements(contents: dict) -> set[str]: |
There was a problem hiding this comment.
This docstring here could explain the purpose of the method in the larger site generation flow.
| # Handle anyOf conditions | ||
| if "anyOf" in contents: | ||
| for item in contents["anyOf"]: | ||
| if "required" in item: |
There was a problem hiding this comment.
What does the required condition in the item enforce? Is there an example of an anyOf requirement that does not have required items nested within?
…bout conditional variables are parsed and how properties table is built. 3. Added 'conditionally required' status in the detailed property documentation.
|
Thanks for expanding the documentation; it’s helpful. The updated version looks good to me. |
All properties that are conditionally required are now represented by gear icon under a new 'conditional required' column in the properties table. These properties are collected by iteratively traversing through all allOf, oneOf, allOf, not, if/then/else json schemas.
Sufficient documentation in the script to describe the implementation.