ASF-ui
ASF-ui copied to clipboard
Use OpenAPI definitions as configuration schema
Description
As title says, the use of GET /Type
and GET /Structure
was replaced by parsing OpenAPI documentation available in /swagger/ASF/swagger.json
. I focused on making existing components work with the mew definition and not much else, to reduce scope of the PR.
Please test it with latest ASF release (V4.2.3.4), as it relies on introduced changes.
Additional information
Closes #871
The code style may be not consistent with the project, our eslint settings are very scuffed (eg. existing code doesn't follow latest rules from plugins) and fixing the code style is out of the scope for this PR.
TODO
- [ ] Default model for new bot - currently we use empty object as a model, which breaks the inputs and sets wrong defaults on fields which didn't break.
- [ ] Extensive testing - last thing we want is to break existing configs, and this change has full potential to do so
- [ ] Adjust UI settings to follow new schema definitions
- [ ] Test if the update didn't break handling of sensitive properties (Bot Config)
Follow up
- Cleanup input logic, normalize variable names
- Abstract schema preparation - currently almost the same logic is repeated in at least 3 components
- Cleanup unused code left from parsing old definitions
Checklist
- [x] My pull request is not a duplicate
- [x] I added a descriptive title to this pull request
- [ ] My code follows the code style of this project
- [x] I have performed a self-review of my own code
Happy belated birthday to our first 1-year old PR 🥳
I'd like to mention ASFs OpenAPI extensions here.
Since there is no official documentation of them on ASFs wiki, I'll just link the monologue of @JustArchi from the discord server for posterity: https://ptb.discord.com/channels/267292556709068800/332735075315744768/859854787634004049
Happy 2nd anniversary. Maybe one day.