-
Notifications
You must be signed in to change notification settings - Fork 43
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
fix(api): Fix openapi documentation display script #805
Conversation
Demo starting at https://maas-io-805.demos.haus |
Codecov Report
@@ Coverage Diff @@
## main #805 +/- ##
==========================================
+ Coverage 61.65% 64.59% +2.93%
==========================================
Files 8 8
Lines 193 209 +16
==========================================
+ Hits 119 135 +16
Misses 74 74
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
I am not sure if the if
clause can be more explicit and whether we might still need parameter descriptions in case there is no multipart/form-data
in the requestBody
.
{%endif%} | ||
{%for property in item[endpoint][method]["requestBody"]["content"]["application/json"]["schema"]["properties"]%} | ||
<p><md-block><code>{{property}}</code> (<em>{{item[endpoint][method]["requestBody"]["content"]["application/json"]["schema"]["properties"][property]["type"]}}</em>): {%if property in item[endpoint][method]["requestBody"]["content"]["application/json"]["schema"]["required"]%}Required{%else%}Optional{%endif%}. {{item[endpoint][method]["requestBody"]["content"]["application/json"]["schema"]["properties"][property]["description"].replace(" -", "\n -")}}</md-block></p> | ||
<p><strong>Request body (multipart/form-data)</strong></p> |
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.
Are you sure this is true for all request_body
s or only the ones with files. Or to put it differently, can we check for item[endpoint][method]["requestBody"]["content"]["multipart/form-data"]
directly?
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.
I think we can check for this, but currently I am sure that this is true for all request bodies - trying this with "application/json" results in errors, but having run this locally with the most recent schema, there are no errors when using "multipart/form-data". I've checked through the schema to verify this as well.
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.
thanks for checking!
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.
LGTM
Done
QA
A few to check:
PUT /MAAS/api/2.0/boot-sources/{boot_source_id}/selections/{id}
DELETE /MAAS/api/2.0/devices/{system_id}/
DELETE /MAAS/api/2.0/devices/{system_id}/
PUT /MAAS/api/2.0/dnsresourcerecords/{id}/
Screenshots
Before
After