Actions
Issue #8941
closedmedia_type list filter doesn't work with ruby bindings, expects array which api doesn't support
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Sprint 99
Quarter:
Description
After upgrading to the pulp_container ruby bindings, when calling the list content_manifests_api and passing media_type as a filter, we get an error:
NoMethodError: undefined method `all?' for "application/vnd.docker.distribution.manifest.v1+json":String
all? is typically called on an array, and looking at the code does show the bindings are expecting an array:
allowable_values = ["application/vnd.docker.distribution.manifest.list.v2+json", "application/vnd.docker.distribution.manifest.v1+json", "application/vnd.docker.distribution.manifest.v2+json", "application/vnd.oci.image.index.v1+json", "application/vnd.oci.image.manifest.v1+json"]
if @api_client.config.client_side_validation && opts[:'media_type'] && !opts[:'media_type'].all? { |item| allowable_values.include?(item) }
fail ArgumentError, "invalid value for \"media_type\", must include one of #{allowable_values}"
end
However if we try to pass an array, we get an error from the server
Response body: {"errors":["Invalid Filter: 'media_type[]'"]}
Actions
Add Ruby templates to expose the 'params_encoder' config from Faraday
I opened a PR upstream with the same changes: https://github.com/OpenAPITools/openapi-generator/pull/9839
fixes: #8941 https://pulp.plan.io/issues/8941