Skip to content

Conversation

@yogesh-badke
Copy link

Implement comprehensive support for JSON Schema Draft-07 conditional validation
keywords to properly document schemas with mode-based configurations.

Changes:

  • Add parsing for allOf, anyOf, oneOf, if, then, else, and const keywords
  • Implement Option 1: Display conditional requirements inline (e.g., "When mode=cluster")
  • Implement Option 4: Generate mode-specific configuration sections with hyperlinks
  • Add recursive nested property rendering in mode-specific sections
  • Track conditional requirements and map properties to controlling mode values
  • Resolve conditional schemas through reference resolution

The implementation provides dual UX approaches:

  1. Inline conditions in the Required column for quick reference
  2. Dedicated mode-specific sections with deep-linked enum values for detailed exploration

Fixes conditional validation documentation where properties required under specific
conditions were incorrectly shown as optional. Now correctly shows:

  • "When mode=cluster" for cluster-specific properties
  • "When mode=sentinel" for sentinel-specific properties
  • Hyperlinked mode-specific sections (e.g., config-cluster, config-sentinel)
  • Fully recursive nested property documentation at any depth

All existing tests pass with no regression.

  Implement comprehensive support for JSON Schema Draft-07 conditional validation
  keywords to properly document schemas with mode-based configurations.

  Changes:
  - Add parsing for allOf, anyOf, oneOf, if, then, else, and const keywords
  - Implement Option 1: Display conditional requirements inline (e.g., "When `mode=cluster`")
  - Implement Option 4: Generate mode-specific configuration sections with hyperlinks
  - Add recursive nested property rendering in mode-specific sections
  - Track conditional requirements and map properties to controlling mode values
  - Resolve conditional schemas through reference resolution

  The implementation provides dual UX approaches:
  1. Inline conditions in the Required column for quick reference
  2. Dedicated mode-specific sections with deep-linked enum values for detailed exploration

  Fixes conditional validation documentation where properties required under specific
  conditions were incorrectly shown as optional. Now correctly shows:
  - "When `mode=cluster`" for cluster-specific properties
  - "When `mode=sentinel`" for sentinel-specific properties
  - Hyperlinked mode-specific sections (e.g., config-cluster, config-sentinel)
  - Fully recursive nested property documentation at any depth

  All existing tests pass with no regression.
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.

1 participant