-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
UI: Parse OpenAPI response correctly if schema includes $ref #14508
Conversation
ui/app/services/path-help.js
Outdated
let props = {}; | ||
const schema = pathInfo?.post?.requestBody?.content['application/json'].schema; | ||
if (schema.$ref) { | ||
// $ref will be shaped like `#/component/schema/MyResponseType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super small comment but components and schemas are plural in the $ref
"$ref": "#/components/schemas/KvLookupRequest"
...but does that affect your mapping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nope! it doesn't, since you're using reduce
and setting the keys on 212
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, but I should probably be accurate in my comment 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! Thanks for the quick fix! 🚀
This PR adds UI support for the changes in #14217
Before this change, the UI was broken where we try to generate the form based on OpenAPI:
After, the form is rendered as expected: