swagger-api / swagger-api/swagger-codegen
Array doesnt accept multiple entries in JAX-RS
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
I recently opened a bug in swagger-ui, but now I think its a problem with swagger codegen. This is the related post: https://github.com/swagger-api/swagger-ui/issues/2175
When I build Code out of a spec which has an Array the Code seems to be right, but when I run I can have max. 1 entry. It doesnt recognize a "," with the collectionFormat csv. It also doesnt work with a "|" when i choose pipe as collection Format. Here is the spec:
"parameters": [
{
"name": "api_key",
"in": "header",
"description": "description",
"required": true,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv"
}
]
Im build a JAX-RS -Jersey server and the swagger Codegen version is 2.1.6 and I run the Code with this:
-i swaggerPolicy.json \
-l jaxrs \
-o D:\Dateien\swagger_restacl_integration\SwaggerRestaclIntegration
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided swaggerPolicy.json and the jaxrs generator command. Inspect how the generated JAX-RS server binds the array header for csv and pipe collection formats. Done means multiple header entries are accepted using the separators specified by collectionFormat.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100