swagger-ui
swagger-ui copied to clipboard
#1515 Fix for array of enums doesn't allow you to specify order.
I reused not used property uniqueItems. If uniqueItems === true than render regular multiselect otherwise list of single select. And if we render array items one by one as single select we can preserve items order.
Description
Motivation and Context
Having ordered enum selection inside array[string] seems natural.
How Has This Been Tested?
Manual
Screenshots (if appropriate):

Checklist
My PR contains...
- [ ] No code changes (
src/is unmodified: changes to documentation, CI, metadata, etc.) - [ ] Dependency changes (any modification to dependencies in
package.json) - [x ] Bug fixes (non-breaking change which fixes an issue)
- [ x] Improvements (misc. changes to existing features)
- [ x] Features (non-breaking change which adds functionality)
My changes...
- [ ] are breaking changes to a public API (config options, System API, major UI change, etc).
- [ ] are breaking changes to a private API (Redux, component props, utility functions, etc.).
- [ ] are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc).
- [x ] are not breaking changes.
Documentation
- [ ] My changes do not require a change to the project documentation.
- [ x] My changes require a change to the project documentation.
- [ ] If yes to above: I have updated the documentation accordingly.
Automated tests
- [ ] My changes can not or do not need to be tested.
- [x ] My changes can and should be tested by unit and/or integration tests.
- [ ] If yes to above: I have added tests to cover my changes.
- [ ] If yes to above: I have taken care to cover edge cases in my tests.
- [x ] All new and existing tests passed.
I'm not sure why uniqueItems is not used. But the way I see it, since it's an array , I think the we should always maintain the order and render those single selects.
The order might be important even if the items are unique.