Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering of nested oneOf selectors #719

Closed
cmeeren opened this issue Nov 21, 2018 · 3 comments
Closed

Rendering of nested oneOf selectors #719

cmeeren opened this issue Nov 21, 2018 · 3 comments

Comments

@cmeeren
Copy link

cmeeren commented Nov 21, 2018

It's great that ReDoc supports nested oneOf, but the rendering can be improved.

Example definition:

ErrorA:
  properties:
    ...

ErrorB:
  properties:
    ...

ErrorC:
  properties:
    ...

ErrorAB:
  oneOf:
    - $ref: '#/components/schemas/ErrorA'
    - $ref: '#/components/schemas/ErrorB'

ErrorABC:
  oneOf:
    - $ref: '#/components/schemas/ErrorAB'
    - $ref: '#/components/schemas/ErrorC'

Currently it renders like this:

image

I suggest at least spacing them out a bit vertically (simple fix - only CSS?).

You could also consider connecting them with lines (probably a bit more work?), like below, but that requires some design of what happens when the list of selectors becomes long enough to break onto a second line.

image

Lines like these will of course only make sense for directly nested oneOf.

@RomanHotsiy
Copy link
Member

Nice suggestion!

PRs are welcome!

@cmeeren
Copy link
Author

cmeeren commented Nov 21, 2018

Unfortunately I'm no front-end/JS dev, so someone else will have to help out here.

@cmeeren
Copy link
Author

cmeeren commented Nov 21, 2018

In any case: If you could just increase the margin a bit, that would go a long way to making this look good. :)

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

No branches or pull requests

2 participants