Project

Profile

Help

Issue #8941

closed

media_type list filter doesn't work with ruby bindings, expects array which api doesn't support

Added by jsherril@redhat.com almost 3 years ago. Updated over 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Sprint/Milestone:
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[]'"]}

Also available in: Atom PDF