swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.94k stars 6.03k forks source link

Array doesnt accept multiple entries in JAX-RS #2961

Open arilynN opened 8 years ago

arilynN commented 8 years ago

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
wing328 commented 8 years ago

@arilynN thanks for reporting the issue. May I know if you've cycle to contribute a fix?

arilynN commented 8 years ago

I havent planned it.

RedEagle commented 7 years ago

Any news on this issue?

wing328 commented 7 years ago

@RedEagle would you have time to contribute the fix? I can show you some good starting points.