-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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] URI encoded $ref not properly decoded #5720
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
I don't know, why the bot added the dart label. The problem is for every language, I think. I tried also Java and there is the problem, too. |
Having a similar issue here: PagerDuty/api-schema#82 Was there any resolution that you found @SimonIT |
I discovered now that if you replace this line Line 389 in c9939a2
with return URLDecoder.decode(ref); the name gets properly decoded. I will make a PR. |
Okay, I tested it myself with the provided command from your issue and this didn't fix your problem. |
* Properly decode $ref fixes #5720 * Specify decoding encoding * Nicer syntax * UTF-8 typo * Unescape special characters * Change order of unescaping to prevent escaped sequences by accident * Comment for special decoding Co-authored-by: Jim Schubert <james.schubert@gmail.com> * Add unit test for simple ref decoding Co-authored-by: Jim Schubert <james.schubert@gmail.com>
Bug Report Checklist
Description
I wanted to generate a dart lib for flutter with the provided swagger yaml config. The problem is, that some of the generated class names contain spaces which are not valid. After writing a fix for it (PR #5693), I used swagger to edit the yaml. Swagger suggests to use
%20
instead of normal spaces inside$ref
definition links because it's an URI (see docs). Now I got the problem, that some class names contain%20
.openapi-generator version
4.2.3
OpenAPI declaration file content or url
https://raw.githubusercontent.com/wbt-solutions/openproject_dart_sdk/master/openProject_swagger.yaml
Command line used for generation
I used the command
java -jar .\openapi-generator-cli-4.2.3.jar generate -g dart -i openProject_swagger.yaml -o openproject_dart_sdk/
inside the Windows Powershell.Steps to reproduce
Execute the command with the provided config and look for example in the model\work_package.dart.
Related issues/PRs
Haven't found any.
Suggest a fix
Properly decode the $ref attribute as URI.
The text was updated successfully, but these errors were encountered: