Skip to content

[28.x] api/types/filters: reimplement ToParamWithVersion#50562

Merged
thaJeztah merged 1 commit intomoby:28.xfrom
thaJeztah:28.x_rewrite_ToParamWithVersion
Jul 29, 2025
Merged

[28.x] api/types/filters: reimplement ToParamWithVersion#50562
thaJeztah merged 1 commit intomoby:28.xfrom
thaJeztah:28.x_rewrite_ToParamWithVersion

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jul 29, 2025

This function depended on the non-exported Args.values field. With the migration of the API to a separate module, we will alias that type, and remove the deprecated ToParamWithVersion function.

This means that we cannot alias the function, and aliasing the Args type means we can't access the non-exported field.

This patch reimplements ToParamWithVersion by unmarshaling the JSON output of the current format, and re-marshaling it to the legacy format.

This is not optimal, but this code-path would only be used for API versions that are deprecated, and is not to be used for any new code.

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

This function depended on the non-exported `Args.values` field.
With the migration of the API to a separate module, we will
alias that type, and remove the deprecated `ToParamWithVersion`
function.

This means that we cannot alias the function, and aliasing the
`Args` type means we can't access the non-exported field.

This patch reimplements `ToParamWithVersion` by unmarshaling
the JSON output of the current format, and re-marshaling it
to the legacy format.

This is not optimal, but this code-path would only be used
for API versions that are deprecated, and is not to be used
for any new code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the 28.4.0 milestone Jul 29, 2025
@thaJeztah thaJeztah merged commit f4595bc into moby:28.x Jul 29, 2025
215 of 217 checks passed
@thaJeztah thaJeztah deleted the 28.x_rewrite_ToParamWithVersion branch July 29, 2025 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants