Skip to content

Represent conditional properties in the properties table#73

Open
shwethanidd wants to merge 3 commits into
prod-sandboxfrom
REBATE-944_represent_cond_reqmt
Open

Represent conditional properties in the properties table#73
shwethanidd wants to merge 3 commits into
prod-sandboxfrom
REBATE-944_represent_cond_reqmt

Conversation

@shwethanidd

Copy link
Copy Markdown
Collaborator

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.

…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 mvgeorgescu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread script.py

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]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This docstring here could explain the purpose of the method in the larger site generation flow.

Comment thread script.py
# Handle anyOf conditions
if "anyOf" in contents:
for item in contents["anyOf"]:
if "required" in item:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@shwethanidd shwethanidd requested review from sudhacde and removed request for KapilDuwadi and sudhacde June 5, 2026 20:59
…bout conditional variables are parsed and how properties table is built. 3. Added 'conditionally required' status in the detailed property documentation.
@sudhacde

sudhacde commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Thanks for expanding the documentation; it’s helpful. The updated version looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants