Skip to content

chore(openapi): type UpdateProductInfo.version as a string in the OpenAPI spec - #1883

Merged
Benoît Cortier (CBenoit) merged 1 commit into
masterfrom
fix/openapi-update-version-string
Jul 29, 2026
Merged

chore(openapi): type UpdateProductInfo.version as a string in the OpenAPI spec#1883
Benoît Cortier (CBenoit) merged 1 commit into
masterfrom
fix/openapi-update-version-string

Conversation

@irvingoujAtDevolution

Copy link
Copy Markdown
Contributor

What

UpdateProductInfo.version is typed VersionSpecification, which lives in devolutions-agent-shared — a crate that does not depend on utoipa. The derived OpenAPI schema therefore emitted a $ref to a VersionSpecification component that is never generated, leaving a dangling reference in gateway-api.yaml.

Why it matters

The dangling $ref makes the spec fail strict OpenAPI validation. The client generator (openapi-generator 7.9.0, validation on, as generate_clients.ps1 runs it) refuses every gateway target:

attribute components.schemas.UpdateProductInfo.VersionSpecification is not of type `schema`
[error] Spec has 1 error.

So the C#, TypeScript and doc clients cannot be regenerated at all until this is fixed. The bug is pre-existing on master (introduced with the Update API in #1726) and stayed latent because nobody had regenerated the clients since.

Fix

Mark the field #[schema(value_type = String)]. VersionSpecification serializes as "latest" or a YYYY.M.D[.R] string, so a plain string schema matches the wire format exactly — the same treatment as the neighbouring UpdateProduct. Regenerated gateway-api.yaml; validation now passes with 0 errors.

Stack

Base of the credential-injection stack (bottom to top):

  1. this PR — make the OpenAPI spec valid again
  2. fix(dgw): decide credential-injection CredSSP protocol once for both legs #1862 — decide credential-injection CredSSP protocol once for both legs
  3. feat(dgw): provision the target-side KDC for credential injection #1865 — provision the target-side KDC for credential injection

`VersionSpecification` lives in devolutions-agent-shared (a crate without utoipa)
and serializes as `"latest"` or a date-version string, so the derived schema
emitted a `$ref` to a `VersionSpecification` component that is never generated.
That dangling reference makes `gateway-api.yaml` fail strict OpenAPI validation,
so the client generator refuses every gateway target (`Spec has 1 error`). Mark
the field `#[schema(value_type = String)]`, matching the wire format and the
existing `UpdateProduct` treatment, then regenerate the spec.
Copilot AI review requested due to automatic review settings July 28, 2026 19:47
@github-actions

Copy link
Copy Markdown

Let maintainers know that an action is required on their side

  • Add the label release-required Please cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module) when you request a maintainer to cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module)

  • Add the label release-blocker Follow-up is required before cutting a new release if a follow-up is required before cutting a new release

  • Add the label publish-required Please publish libraries (`Devolutions.Gateway.Utils`, OpenAPI clients, etc) when you request a maintainer to publish libraries (Devolutions.Gateway.Utils, OpenAPI clients, etc.)

  • Add the label publish-blocker Follow-up is required before publishing libraries if a follow-up is required before publishing libraries

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the generated Gateway OpenAPI specification’s dangling VersionSpecification reference.

Changes:

  • Models UpdateProductInfo.version as a string in OpenAPI.
  • Regenerates the specification with the corrected schema and current version.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
devolutions-gateway/src/api/update.rs Overrides the OpenAPI field type while preserving the Rust type.
devolutions-gateway/openapi/gateway-api.yaml Replaces the invalid reference with a documented string schema.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@CBenoit Benoît Cortier (CBenoit) changed the title fix(dgw): type UpdateProductInfo.version as a string in the OpenAPI spec chore(dgw): type UpdateProductInfo.version as a string in the OpenAPI spec Jul 29, 2026
@CBenoit Benoît Cortier (CBenoit) changed the title chore(dgw): type UpdateProductInfo.version as a string in the OpenAPI spec chore(openapi): type UpdateProductInfo.version as a string in the OpenAPI spec Jul 29, 2026
@CBenoit
Benoît Cortier (CBenoit) merged commit 2072e44 into master Jul 29, 2026
45 checks passed
@CBenoit
Benoît Cortier (CBenoit) deleted the fix/openapi-update-version-string branch July 29, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants