openapi-generator: [BUG] [Ruby] client escapes all path parameters
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- What’s the version of OpenAPI Generator used?
- Have you search for related issues/PRs?
- What’s the actual output vs expected output?
- [Optional] Bounty to sponsor the fix (example)
Description
Our application’s OpenAPI schema contains path parameters that contains ‘/’. The latest generated Ruby client stopped working for all the operations that contain a path parameter with ‘/’ in it. This is a regression for our use case of openapi-generator.
openapi-generator version
I am using the latest openapi-generator-cli docker image. This is a regression since v4.0.0 tag.
OpenAPI declaration file content or url
https://docs.pulpproject.org/en/3.0/nightly/api.json
Command line used for generation
docker run -u $(id -u) --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate \
-i /local/api.json \
-g ruby \
-o /local/$1-client \
-DgemName=$1_client \
-DgemLicense="GPLv2" \
-DgemVersion=0.1.0rc2 \
--skip-validate-spec \
--strict-spec=false
Steps to reproduce
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/pull/3039
Suggest a fix
@ccouzens, could you make the path parameter escaping optional?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 25 (23 by maintainers)
Commits related to this issue
- Ruby-client: Don't encode slashes if strict-spec false (#3204) URL-special characters such as /,?,% should be encoded when inside path parameters. I changed the Ruby-client to do so. https://github... — committed to OpenAPITools/openapi-generator by ccouzens 5 years ago
- Ruby-client: Don't encode slashes if strict-spec false (#3204) URL-special characters such as /,?,% should be encoded when inside path parameters. I changed the Ruby-client to do so. https://github... — committed to DataDog/datadog-api-client-ruby by ccouzens 5 years ago
- Move templates in clients (#255) * [Ruby] Rename files/folders (#534) * Rename templateDir: rails5 -> ruby-on-rails-server * Rename script: rails5-petstore-server.sh -> ruby-on-rails-server-pet... — committed to DataDog/datadog-api-client-ruby by api-clients-generation-pipeline[bot] 3 years ago
- Ruby-client: Don't encode slashes if strict-spec false (#3204) URL-special characters such as /,?,% should be encoded when inside path parameters. I changed the Ruby-client to do so. https://github... — committed to DataDog/datadog-api-client-ruby by ccouzens 5 years ago
Thank you @autopp 😃 I’ll close #3201 and #3130. They were both alternative approaches. We went with #3204 so they’re not needed.
I’ve started working on a branch for
x-allow-dynamic-resource. Now that I’ve started it, I’d like to finish it (because I’m learning a fair bit by doing the work).But after I’ve done that, I’m happy to do a PR for
--strict-spec.