fhir-swagger icon indicating copy to clipboard operation
fhir-swagger copied to clipboard

Invalid swagger - duplicated query parameters

Open zsim0n opened this issue 6 years ago • 3 comments

Hello, I've tried to generate a swagger with the following command (latest clone)

fhir-swagger --fhir_url "http://test.fhir.org/r4" --conformance_path="/metadata?_format=application/json" --r4  --output swagger.json

The generated swagger.json contains errors: Validation failed. /paths/Account/get has duplicate parameters Validation failed. Found multiple query parameters named _filter

Exploring the json - it looks like all the underscore parameters are duplicated. What am I doing wrong? Thx

zsim0n avatar Feb 28 '19 22:02 zsim0n

This could easily be a bug on our end as well, or something specific to your FHIR spec - happy to accept a PR that fixes this!

rbren avatar Mar 01 '19 16:03 rbren

As much as I understand the server side on R4 contains duplications in the metadata. On the tool side there is no validation on this .push() so it ends up at duplication. On the other hand I found out there is active topic on the official fhir chat about openAPI tooling and it seems the community is also working on this... Might would be interesting to join the efforts.

zsim0n avatar Mar 01 '19 22:03 zsim0n

I too faced a similar problem where there were duplications on metadata so till we find a perfect validation for removing in the metadata adding a check here will help others like myself. Will raise PR shortly with my fix.

NagarajanI2i avatar Jun 01 '20 18:06 NagarajanI2i