-
Notifications
You must be signed in to change notification settings - Fork 9.2k
improve enum display in JSONViewer #10597
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
base: master
Are you sure you want to change the base?
improve enum display in JSONViewer #10597
Conversation
Hi @sajdakabir, Thanks for trying to improve JSON Viewer! Unfortunately, there are some issues with this solution:
This can be seen using this definition: openapi: 3.1.0
info:
title: JSON Viewer
version: 1.0.0
components:
schemas:
Primitive:
enum:
- 123
- test
examples:
- 123
- test
Complex:
enum:
# object in enum
- prop1: abc
prop2:
nestedProp1: test
prop3:
nestedProp2:
- test1
-
- test2
- test3
# array in enum
-
- test
- 123
- prop1: abc
prop2:
nestedProp1: test
prop3:
nestedProp2:
- test1
-
- test2
- test3
-
- test
- 123
- prop1: abc
prop2:
nestedProp1: test
prop3:
nestedProp2:
- test1
-
- test2
- test3
examples:
# object in examples
- prop1: abc
prop2:
nestedProp1: test
prop3:
nestedProp2:
- test1
-
- test2
- test3
# array in examples
-
- test
- 123
- prop1: abc
prop2:
nestedProp1: test
prop3:
nestedProp2:
- test1
-
- test2
- test3
-
- test
- 123
- prop1: abc
prop2:
nestedProp1: test
prop3:
nestedProp2:
- test1
-
- test2
- test3 These issues would need to be addressed, so the solution might require more extensive changes. |
looking into it |
@glowcloud an you check the latest commit and let me know if anything else needs tweaking? |
Description
Modified CSS in enum and examples components to hide secondary name elements and remove "=" separators for cleaner enum value display.
Motivation and Context
Fixes visual clutter in enum display introduced with JSONViewer component in v5.20.1. Hides secondary elements and separators that create unnecessary visual noise.
Fixes: #10555
How Has This Been Tested?
Visual testing with various enum configurations
Verified cross-browser compatibility
Confirmed no regression in existing functionality
Tested integration with JSONViewer component
Screenshots :
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests