-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Dynamic OpenAPI UI #6209
Dynamic OpenAPI UI #6209
Conversation
…nto openapi-models
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.
Sorry, lots of little comments! This looks good, the main thing I am worried about is using pathForType
for the place in the model that determines the OpenAPI url. Is there a way we can do that differently?
details.type = 'number'; | ||
} | ||
let editType = details.type; | ||
if (details.format === 'seconds') { |
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.
will seconds always mean it's a ttl?
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.
that was my understanding. @kalafut is this the case?
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.
correction: seconds means it's a duration, meaning a ttl form field would make most sense
…eed to know anything about it
//as determined by the expandOpenApiProps util | ||
getProps(helpUrl, path, backend) { | ||
return this.ajax(helpUrl, backend).then(help => { | ||
let props = help.openapi.paths[path].post.requestBody.content['application/json'].schema.properties; |
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.
Do we know here that there will always be one path (at least until we get to more complex stuff with CRUD views, etc)? if so, what do you think about doing paths[0] instead of paths[path] ? When looking through the other code I wasn't sure what path
was in those objects, but if this is all we're using it for, maybe we don't need it...
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.
paths is an object, so it's either this or doing something like
let path = Object.keys( help.openapi.paths)[0]
let props = paths[path].post.requestBody.content['application/json'].schema.properties;
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.
Ahh yeah I didn't realize that, but yeah what do you think about getting the keys if there's only going to be one?
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.
done and done
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.
Excited for this! May need to rebase to get the changelog changes out of there, but 👍 - are the go changes ready to merge too?
{ default: ['organization'] }, | ||
{ | ||
'GitHub Options': ['baseUrl'], | ||
}, | ||
]; | ||
if (this.newFields) { | ||
groups = combineFieldGroups(groups, this.newFields, []); |
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.
this combines the fields we have defined in the model with those returned from OpenAPI. new fields should not be added to the model -- ideally we should transition to only using fields from OpenAPI since it's meant to be the source of truth.
|
||
const { attr } = DS; | ||
|
||
export default AuthConfig.extend({ | ||
useOpenAPI: true, |
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.
whether or not this model class should be re-opened and extended with additional fields from OpenAPI.
pull just frontend commits from #6129