chore(openapi): type UpdateProductInfo.version as a string in the OpenAPI spec - #1883
Conversation
`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.
Let maintainers know that an action is required on their side
|
There was a problem hiding this comment.
Pull request overview
Fixes the generated Gateway OpenAPI specification’s dangling VersionSpecification reference.
Changes:
- Models
UpdateProductInfo.versionas 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.
What
UpdateProductInfo.versionis typedVersionSpecification, which lives indevolutions-agent-shared— a crate that does not depend on utoipa. The derived OpenAPI schema therefore emitted a$refto aVersionSpecificationcomponent that is never generated, leaving a dangling reference ingateway-api.yaml.Why it matters
The dangling
$refmakes the spec fail strict OpenAPI validation. The client generator (openapi-generator7.9.0, validation on, asgenerate_clients.ps1runs it) refuses every gateway target: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)].VersionSpecificationserializes as"latest"or aYYYY.M.D[.R]string, so a plainstringschema matches the wire format exactly — the same treatment as the neighbouringUpdateProduct. Regeneratedgateway-api.yaml; validation now passes with 0 errors.Stack
Base of the credential-injection stack (bottom to top):