Skip to content

api: align Topology swagger with Segments JSON shape#52358

Merged
thaJeztah merged 2 commits intomoby:masterfrom
geekcoderr:52355-topology-swagger
Apr 19, 2026
Merged

api: align Topology swagger with Segments JSON shape#52358
thaJeztah merged 2 commits intomoby:masterfrom
geekcoderr:52355-topology-swagger

Conversation

@geekcoderr
Copy link
Copy Markdown
Contributor

@geekcoderr geekcoderr commented Apr 13, 2026

Updated the OpenAPI/Swagger definition for Topology in api/swagger.yaml so it matches the JSON produced by the Go type in api/types/volume/cluster_volume.go (Topology with a Segments field of type map[string]string). Previously the spec described a flat object with string values at the top level, which did not match daemon output (for example under ClusterVolume.Info.AccessibleTopology) and broke clients generated from the spec.

  • How I did it

Replaced the Topology schema’s root-level additionalProperties: string with an explicit properties.Segments object whose additionalProperties are strings. Existing $ref: "#/definitions/Topology usages (e.g. AccessibleTopology, accessibility requirements) now resolve to the correct shape without further edits.

  • How to verify it

Inspect api/swagger.yaml → definitions → Topology: it should show a Segments property wrapping the map.
Compare with a real GET /volumes/{name} (or equivalent) response for a cluster volume with CSI topology: each topology entry should be an object with a Segments map, matching the updated schema.

  • Human readable description for the release notes
    Fix Swagger definition for volume topology so it matches the Segments JSON field returned by the API.

@geekcoderr geekcoderr changed the title fix: align Topology swagger with Segments JSON shape api: align Topology swagger with Segments JSON shape Apr 13, 2026
@vvoland vvoland added the kind/bugfix PR's that fix bugs label Apr 15, 2026
@geekcoderr
Copy link
Copy Markdown
Contributor Author

OL8 VM integration (non-rootless) failed in .integration-daemon-stop after TestAttachDisconnectLeak; logs show DONE 84 tests then daemon stop / wait errors. integration (rootless) on the same template passed. Looks unrelated to the swagger-only change, could a maintainer re-run the failed job when convenient?

@fussybeaver
Copy link
Copy Markdown
Contributor

Don't we need to change all the ./api/docs/v1.44.yaml all the way to ./api/docs/v1.54.yaml to ensure clients that generate from older api versions are also corrected?

Apply the same Topology schema fix as api/swagger.yaml to v1.42–v1.54
document snapshots so clients generating from pinned API versions see the
correct Segments map shape.

Signed-off-by: Nishant Maheshwari <[email protected]>
Made-with: Cursor
@geekcoderr
Copy link
Copy Markdown
Contributor Author

@fussybeaver
Applied the same Topology / Segments schema to api/docs/v1.42.yaml through v1.54.yaml so pinned OpenAPI versions stay consistent with api/swagger.yaml. v1.41.yaml unchanged (no Topology definition there).

@thaJeztah thaJeztah added this to the 29.4.1 milestone Apr 18, 2026
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@thaJeztah thaJeztah merged commit 179985c into moby:master Apr 19, 2026
206 of 212 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API swagger doc for Topology inconsistent with Go implementation

4 participants