Visitar URL original
Update swagger specification by stgraber · Pull Request #3813 · lxc/incus · GitHub
Skip to content

Update swagger specification - #3813

Merged
stgraber merged 11 commits into
lxc:mainfrom
stgraber:api
Aug 11, 2026
Merged

stgraber merged 11 commits into
lxc:mainfrom
stgraber:api

Conversation

@stgraber

Copy link
Copy Markdown
Member

Fixes swagger warnings/errors, similar to what was by @breml on Operations Center.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
@github-actions github-actions Bot added Documentation Documentation needs updating API Changes to the REST API labels Aug 11, 2026

@breml breml left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bensmrs bensmrs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving since those are just a nitpick and a comment for the future.

Comment thread cmd/incusd/images.go
// type: object
// additionalProperties:
// type: string
// description: Descriptive properties (URL encoded)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn’t everything URL-encoded?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, no, it's actually correct to flag this one as it's extra weird in the way it's encoded/decoded.

https://github.com/lxc/incus/blob/main/cmd/incusd/images.go#L928

We used to have something similar for aliases but we now support passing just a simple value through so folks playing with curl don't pull their hair out.

https://github.com/lxc/incus/blob/main/cmd/incusd/images.go#L937

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Erf, you’re reminding me why I refrain from opening any file called image.go and images.go in the codebase.

// description: Instance request (or raw backup file)
// required: false
// schema:
// $ref: "#/definitions/InstancesPost"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point we’ll have to think about how to encode in swagger the fact that we accept binary data in some endpoints (OTTOMH backups, images and NVRAM), if we can do better than a simple mention in the description.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, plain swagger struggles with varying response encoding. OpenAPI can handle it, but then we'd have to find a way to generate a modern OpenAPI spec rather than the older Swagger format.

@stgraber
stgraber merged commit c60fde1 into lxc:main Aug 11, 2026
135 of 137 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Changes to the REST API Documentation Documentation needs updating

Development

Successfully merging this pull request may close these issues.

Improve Swagger 2.0 compatibility of generated API specification (doc/rest-api.yaml)

3 participants