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

[BUG] Ruby Faraday client encodes arrays in parameters only for Rails (array_name[]) #9838

Closed
dkliban opened this issue Jun 24, 2021 · 0 comments · Fixed by #9839
Closed

Comments

@dkliban
Copy link
Contributor

dkliban commented Jun 24, 2021

Description

The following code produces query parameters that are intended for Rails app:

@manifest_api = PulpContainerClient::ContentManifestsApi.new
@manifest_api.list({media_type: ["application/vnd.docker.distribution.manifest.v1+json", "application/vnd.docker.distribution.manifest.v2+json"]})
"GET /pulp/api/v3/content/container/manifests/?media_type%5B%5D=application%2Fvnd.docker.distribution.manifest.v1%2Bjson&media_type%5B%5D=application%2Fvnd.docker.distribution.manifest.v2%2Bjson HTTP/1.1" 400

Django apps expect the URL to be encoded without the %5B%5D.

"GET /pulp/api/v3/content/container/manifests/?media_type=application%2Fvnd.docker.distribution.manifest.v1%2Bjson&media_type=application%2Fvnd.docker.distribution.manifest.v2%2Bjson HTTP/1.0" 200
openapi-generator version

4.3.1+

Suggest a fix

Faraday supports passing in params_encoder. The configuration object needs to accept a params_encoder.

lostisland/faraday#78 (comment)

dkliban added a commit to dkliban/openapi-generator that referenced this issue Apr 4, 2022
The partial templates were renamed because they no longer hold tls
settings exclusively.

fixes: OpenAPITools#9838
dkliban added a commit to dkliban/openapi-generator that referenced this issue Apr 5, 2022
The partial templates were renamed because they no longer hold tls
settings exclusively.

fixes: OpenAPITools#9838
wing328 pushed a commit that referenced this issue Apr 9, 2022
…9839)

The partial templates were renamed because they no longer hold tls
settings exclusively.

fixes: #9838
cachescrubber pushed a commit to cachescrubber/openapi-generator that referenced this issue Apr 9, 2022
…penAPITools#9839)

The partial templates were renamed because they no longer hold tls
settings exclusively.

fixes: OpenAPITools#9838
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant