Skip to content

Add Openapi 3.1 if then else constructs to the constraint rendering. - #324

Open
Xarno wants to merge 1 commit into
Authress-Engineering:release/2.4from
Xarno:origin/release/2.4
Open

Xarno wants to merge 1 commit into
Authress-Engineering:release/2.4from
Xarno:origin/release/2.4

Conversation

@Xarno

@Xarno Xarno commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Add the display of if then else.
Implements #323

Disclosure: Was entirely written by claude code.

@wparad

wparad commented Nov 20, 2026

Copy link
Copy Markdown
Member

Disclosure: Was entirely written by claude code.

@Xarno you'll need to fully review the code first then. Additionally, before the PR can go up we'll need to identity multiple options for different designs as I don't believe the current implementation handles all the potential edge cases, realistically then if then, really needs to be rendered the same was the complex type "one of". I would expect it work almost identically, the one exception being the description of the condition.

@Xarno

Xarno commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

I am open for a different display of the if/then. I am not sure if a synthetic one of display helps here, how much should it repeat? All fields and then there is one tiny difference? But if you change a $ref on the other hand it would be quite broad and would probably look better in a new table row.

The json schema says if then can be stand alone, multiple variants need to be wrapped in allOf Array. I think the pullrequest will currently handle only the allOf wrapped case. https://json-schema.org/understanding-json-schema/reference/conditionals#ifthenelse

@wparad

wparad commented Nov 24, 2026

Copy link
Copy Markdown
Member

I see one of and if/else to be exactly the same implementation with the only difference being the description and key name display. Since one of code already handles everything, an exact duplicate of that code seems like the best approach, it should solve all our needs and automatically handle all edge cases.

I don't know what you mean by "stand alone" here. Us there a specific schema you have that would not be handled by the suggestion?

This branch has not been deployed

No deployments
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.

2 participants