Repository navigation
Conversation
Unmodified copy of api/openapi.yaml from moby/moby at tag api/v1.57.0. Docker Engine 29.10.0 moved the API specification to OpenAPI 3.2: https://docs.docker.com/engine/release-notes/29/#-engine-api-specification-moves-to-openapi-32 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
openapi-generator (7.27.0, and 7.28.0 as the latest release) does not recognize "openapi: 3.2.0" and falls back to the Swagger 1.x/2.0 parsers, which fail with thousands of errors. The spec uses no 3.2-only constructs (itemSchema, $self, querystring parameters, additionalOperations, tag parent/kind, ...), and it validates without errors when declared as 3.1.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the local adjustments of the v1.52 spec (see 275c8e5), adapted to the OpenAPI 3.x layout (components/schemas): - nullability and required fields (Health, HealthcheckResult, ContainerConfig, DriverData, ImageInspect, ImageSummary, Volume, ContainerState, ContainerCreateResponse, ImageHistoryResponseItem.Tags) - x-enum-varnames for ChangeType and SystemInfo.CgroupVersion - StopSignal default "SIGTERM" ContainerConfig.StopTimeout keeps the upstream definition, because upstream removed its default (the daemon-wide default-stop-timeout applies). New for v1.57: - Comment out "enum: [{}]" in the additionalProperties of ExposedPorts and Volumes. With the OpenAPI 3.1 parser, openapi-generator turns them into a single-value enum instead of Map<String, Any>. - Use "[aliases]" instead of "[aliases...]" in the hosts description, which ktlint fails to parse as KDoc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated with openapi-generator 7.27.0 from the OpenAPI 3.1-declared spec (./gradlew :api-model-v1-57:updateApiModelSources openApiGenerateCleanupGeneratedCode, then ktlintFormat). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The spec's default values describe what the daemon does when a field is omitted. Generating them as Kotlin defaults makes the client send them explicitly, which is not always the same as omitting them. For example, ContainerConfig.AttachStdout/AttachStderr default to true in the spec, while the daemon treats an omitted field as false, and an explicit StopSignal "SIGTERM" overrides an image's STOPSIGNAL. Deserialized responses would also pretend to have values the daemon didn't send. Override the kotlin data_class_opt_var.mustache template, so that optional properties always default to null. Required properties keep their defaults. Also drop the StopSignal default "SIGTERM" that was carried over from the v1.52 spec adjustments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy the ContainerCreateRequest/ContainerUpdateRequest field-count tests from
v1.52, and add OmittedDefaultsTest: minimal requests must survive a Moshi
round trip without gaining default values, and absent response fields must
stay null.
The same round trip through the v1.52 model turns {"Image":"alpine"} into
{"AttachStdin":false,"AttachStdout":true,"AttachStderr":true,"Tty":false,
"OpenStdin":false,"StdinOnce":false,"Image":"alpine","StopSignal":"SIGTERM"}.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unmodified copy of api/swagger.yaml from moby/moby at tag api/v1.57.0 (identical to api/docs/v1.57-swagger.yaml there). It is not used by the build, which keeps generating from docker-engine-api-v1.57.yaml. Since moby/moby#53630, api/openapi.yaml (OpenAPI 3.2) is the source of truth of the Engine API. moby derives swagger.yaml from it for existing tooling, e.g. their go-swagger code generation, and only api/v1.57 gets an additional per-version Swagger 2.0 copy. We follow the source of truth, even if we have to modify it: openapi-generator (7.28.0) cannot parse OpenAPI 3.2, because swagger-parser and swagger-core don't support it yet (swagger-api/swagger-parser#2248, swagger-api/swagger-parser#2401, swagger-api/swagger-core#5326 and OpenAPITools/openapi-generator#25484 are open). Hence the 3.1 declaration and the local model fixes in docker-engine-api-v1.57.yaml. The Swagger 2.0 variant helps to compare both parse paths. Generated from the unpatched specs (same config and templates), the models differ in 12 properties only: - swagger.yaml keeps ExposedPorts/Volumes as Map<String, Any>, while the 3.1 path needs the "enum: [{}]" workaround. - The 3.1 path types ContainerStatsResponse.Networks as Map<String, ContainerNetworkStats?> instead of Any, and uses Any? instead of Any for untyped items (*DiskUsage.Items, NetworkInspect.Services). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docker Engine 29.10.0 ships API v1.57 and moves the Engine API specification to OpenAPI 3.2 (release notes, moby/moby#53630). This adds an
api-model-v1-57module generated from that new source of truth.Commits
api/openapi.yamlfrom moby at tagapi/v1.57.0.components/schemaslayout. New for v1.57:enum: [{}]is commented out forExposedPorts/Volumes. Otherwise the 3.1 parse path generates a single-value enum instead ofMap<String, Any>.[aliases...]is changed back to[aliases], because ktlint fails to parse the original in KDoc.data_class_opt_var.mustachemakes optional properties default tonull.AttachStdout/AttachStderrdefault totruein the spec, while the daemon treats omitted fields asfalse. An explicitStopSignal: "SIGTERM"overrides an image'sSTOPSIGNAL.OmittedDefaultsTest. The same round trip through the v1.52 model turns{"Image":"alpine"}into{"AttachStdin":false,"AttachStdout":true,"AttachStderr":true,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Image":"alpine","StopSignal":"SIGTERM"}.api/swagger.yamlfrom the same tag, not used by the build.Upstream status of OpenAPI 3.2 support
All of these are open and have no maintainer review yet:
Once 3.2 is supported, the 3.1 declaration (commit 2) can be dropped.
Notes
docker run, it should setAttachStdout/AttachStderrexplicitly, as docker/cli does.🤖 Generated with Claude Code