Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All but one array parameters missing from URI in VCR cassette #910

Open
ianballou opened this issue Nov 4, 2021 · 3 comments
Open

All but one array parameters missing from URI in VCR cassette #910

ianballou opened this issue Nov 4, 2021 · 3 comments

Comments

@ianballou
Copy link

When making a GET request with array arguments in the URI, only one of the array elements makes it into the URI.

Example request log (here, media_type is the array):

Nov  4 20:42:16 centos7-katello-devel pulpcore-api: pulp [7b866b689113480690e586b795e92db9]:  - - [04/Nov/2021:20:42:16 +0000] "GET /pulp/api/v3/content/container/manifests/?limit=2000&media_type=application%2Fvnd.docker.distribution.manifest.v1%2Bjson&media_type=application%2Fvnd.docker.distribution.manifest.v2%2Bjson&media_type=application%2Fvnd.oci.image.index.v1%2Bjson&offset=0&repository_version=%2Fpulp%2Fapi%2Fv3%2Frepositories%2Fcontainer%2Fcontainer%2F40202db4-20ad-449e-a892-962c66a52282%2Fversions%2F1%2F HTTP/1.1" 200 8812 "-" "OpenAPI-Generator/2.9.0/ruby"

Example VCR snippet that is missing params:

- request:
    method: get
    uri: https://centos7-katello-devel.cannolo.example.com/pulp/api/v3/content/container/manifests/?limit=2000&media_type=application/vnd.oci.image.index.v1%2Bjson&offset=0&repository_version=/pulp/api/v3/repositories/container/container/40202db4-20ad-449e-a892-962c66a52282/versions/1/
    body:
      encoding: US-ASCII
      base64_string: ''
    headers:
      Content-Type:
      - application/json
      User-Agent:
      - OpenAPI-Generator/2.9.0/ruby
      Accept:
      - application/json
      Authorization:
      - Basic ...
      Accept-Encoding:
      - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
...

It seems like only the last array parameter is kept.

The VCR configuration is done here, in case it's helpful: https://github.com/Katello/katello/blob/master/test/support/vcr.rb

Ruby 2.7.3
Gem 3.1.6
Rails 6.0.3.7
VCR 3.0.3

@olleolleolle
Copy link
Member

I am guesting the supported kind of URL query parameter that becomes an array looks like: media_type[]

@MrJoy
Copy link

MrJoy commented Jul 7, 2023

Digging through the code, this appears to be happening somewhere in Webmock or Addressable.

@MrJoy
Copy link

MrJoy commented Jul 7, 2023

This may be the underlying issue: bblimke/webmock#764

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants