We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm using the swift4 generator, with a Swagger 2 spec, and an array parameter with collectionFormat=csv. The parameter looks like:
{ "name": "categories", "in": "path", "required": true, "type": "array", "items": { "type": "string" }, "collectionFormat": "csv" }
It generates code that (correctly) expects an array of strings:
open class func usersGet(categories: [String], completion: @escaping ((_ data: [User]?,_ error: Error?) -> Void)) {
But if I pass an array to it:
DefaultAPI.usersGet(categories: ["sample"] )
it URL-encodes the array literal, rather than using comma-separated values as specified in collectionFormat:
GET /users/%5B%22sample%22%5D
I'm curious if this will be an issue with all generator types.
4.0.0-SNAPSHOT
https://gist.github.com/jacobweber/2a8b3145952464997545d212772a1b96
java -jar /path/to/openapi-generator-cli.jar generate -i /path/to/spec.json -g swift4 -o /path/to/output
See above
None
This is not Swift, but swagger-codegen had a fix for one Java client here, and a PR for another one here.
The text was updated successfully, but these errors were encountered:
👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
Sorry, something went wrong.
Also happening with -g java -Dlibrary=okhttp-gson.
-g java -Dlibrary=okhttp-gson
objc is even weirder -- it sends something like GET /users/%28%0A%20%20%20%20sample%0A%29, which decodes to:
GET /users/%28%0A%20%20%20%20sample%0A%29
( sample )
No branches or pull requests
Bug Report Checklist
Description
I'm using the swift4 generator, with a Swagger 2 spec, and an array parameter with collectionFormat=csv. The parameter looks like:
It generates code that (correctly) expects an array of strings:
But if I pass an array to it:
it URL-encodes the array literal, rather than using comma-separated values as specified in collectionFormat:
I'm curious if this will be an issue with all generator types.
openapi-generator version
4.0.0-SNAPSHOT
OpenAPI declaration file content or url
https://gist.github.com/jacobweber/2a8b3145952464997545d212772a1b96
Command line used for generation
Steps to reproduce
See above
Related issues/PRs
None
Suggest a fix
This is not Swift, but swagger-codegen had a fix for one Java client here, and a PR for another one here.
The text was updated successfully, but these errors were encountered: