Openapi-generator: [BUG] Validation error: "There are duplicate parameter values"

Created on 9 Apr 2019  路  10Comments  路  Source: OpenAPITools/openapi-generator

Bug Report Checklist

  • [x] Have you provided a full/minimal spec to reproduce the issue?
  • [x] Have you validated the input using an OpenAPI validator (example)?
  • [x] What's the version of OpenAPI Generator used?
  • [x] Have you search for related issues/PRs?
  • [x] What's the actual output vs expected output?
Validating spec (bundle.oas3.yaml)
Errors:
        -attribute paths.'/anPath'(get).parameters.There are duplicate parameter values

[error] Spec has 1 errors.
Description

A wrong validation error when using external $ref

openapi-generator version

4.0.0-SNAPSHOT

OpenAPI declaration file content or url

reproducers.zip

Steps to reproduce

openapi-generator-cli validate -i bundle.oas3.yaml

Related issues/PRs

https://github.com/swagger-api/swagger-parser/issues/1063

Suggest a fix

https://github.com/swagger-api/swagger-parser/pull/1065

Bug

Most helpful comment

I have prepared PR https://github.com/OpenAPITools/openapi-generator/pull/2775 to update Swagger-Parser

All 10 comments

I almost have sure that this issue is related to one that I've found in the swagger-parser.
As this team already is bundling an own parser jar then you could also try and apply the fix proposed.

unfortunately the PR at swagger-api/swagger-parser#1065 is not working when the parameters are in an external file. :(

We are facing the same issue.

@Emdee89 , it was fixed by swagger-parser team today.
Now we need to wait for the fix to be merged in the branch used by openapi-generator.

@cvgaviao Thanks for letting me know. Any rough pointer by when this will be released in a new version of the openapi-generator?

@Emdee89,
well, only the openapi-generator team can answer that :D
I've tested my generation with swagger-parser master branch, but they are using a version from their own branch.

@jmini , may I ask you to take a look on the recent swagger-parser PR that fixes this ?

I have prepared PR https://github.com/OpenAPITools/openapi-generator/pull/2775 to update Swagger-Parser

I have updated Swagger-Parser.
Can you check the latest 4.0.0-SNAPSHOT version of OpenAPI Generator?

I've confirmed that the validate function is no longer returning erroneous There are duplicate parameter values messages after https://github.com/OpenAPITools/openapi-generator/pull/2775. So https://github.com/swagger-api/swagger-parser/issues/1063 has now been fixed in openapi-generator. 馃帀 I think this issue can be closed. Thanks for your help @jmini!

Was this page helpful?
0 / 5 - 0 ratings