-
Notifications
You must be signed in to change notification settings - Fork 930
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 swagger issue in the instance rebuild endpoint #12137
Fix swagger issue in the instance rebuild endpoint #12137
Conversation
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.
Have you tested this?
I don't know enough about the syntax to be sure, but the current output suggests that there is something wrong with the parameter syntax (since they don't show up correctly).
doc/rest-api.yaml
Outdated
@@ -8311,7 +8311,7 @@ paths: | |||
summary: Bulk instance state update | |||
tags: | |||
- instances | |||
/1.0/instances/{instance_name}/rebuild: | |||
/1.0/instances/{instance}/rebuild: |
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.
/1.0/instances/{instance}/rebuild: | |
/1.0/instances/{name}/rebuild: |
doc/rest-api.yaml
Outdated
@@ -8311,7 +8311,7 @@ paths: | |||
summary: Bulk instance state update | |||
tags: | |||
- instances | |||
/1.0/instances/{instance_name}/rebuild: | |||
/1.0/instances/{instance}/rebuild: | |||
post: | |||
consumes: | |||
- application/octet-stream |
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.
The operation ID (just below this line) is duplicated.
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.
The other sections all have a description field as well.
fe59d30
to
74dd387
Compare
This looks better, except that there still is an empty |
2401029
to
3d1ea0d
Compare
Is this ready to be merged? |
shared/api/instance.go
Outdated
@@ -174,7 +174,7 @@ type InstancePut struct { | |||
// API extension: instances_rebuild. | |||
type InstanceRebuildPost struct { | |||
// Rebuild source | |||
Source InstanceSource `json:"source" yaml:"source"` | |||
Source InstanceSource `yaml:",inline"` |
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 is an api breakage I don't think we can change it.
What was the thinking behind this?
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.
It was just a test to see the output of the readthedoc documentation but it does not seem to be what I want. Now I reverted 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.
Now this https://canonical-ubuntu-documentation-library--12137.com.readthedocs.build/lxd/en/12137/api/#/instances/instance_rebuild_post looks good so I'd say this is ready to be merged. What do you think @ru-fu ?
3d1ea0d
to
dab1870
Compare
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.
Let's stay consistent with how the other entries do it - a short summary and a longer description.
Otherwise this looks good to me.
post: | ||
consumes: | ||
- application/octet-stream | ||
operationId: instance_rebuild_post |
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.
operationId: instance_rebuild_post | |
description: Rebuild an instance using an alternate image or as empty. | |
operationId: instance_rebuild_post |
doc/rest-api.yaml
Outdated
$ref: '#/responses/NotFound' | ||
"500": | ||
$ref: '#/responses/InternalServerError' | ||
summary: Rebuild an instance using an alternate image or as empty. |
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.
summary: Rebuild an instance using an alternate image or as empty. | |
summary: Rebuild an instance |
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
dab1870
to
5adb102
Compare
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
No description provided.