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

Issue parsing pointers in external files

Open hilkeheremans opened this issue 9 years ago • 4 comments

Hi there,

Great work on swagger-parser. I'm having an issue though: bundling pointers inside an externally reffed file seems to include the name of the pointer, where it shouldn't. I'm guessing the pointers are pretty much ignored.

Try parsing https://github.com/OAI/OpenAPI-Specification/tree/master/examples/v2.0/yaml/petstore-separate from the OpenAPI specs (the entry point is spec/swagger.api), and then validating it.

File spec/swagger.apirefers to parameters.yaml#/tagsParam. Bundling will include the parameters.yaml file and even select tagsParam, but it also -- incorrectly -- includes the tagsParamtag itself, rendering the resulting swagger.json invalid.

Let me know if I missed something here! Thanks for taking a look.

hilkeheremans avatar Feb 01 '16 11:02 hilkeheremans

Just to add - if the issue can be verified - I would guess this issue belongs more in json-schema-ref-parser than here.

hilkeheremans avatar Feb 01 '16 12:02 hilkeheremans

Yeah, that's a bug that has been fixed in the latest version of json-schema-ref-parser, but there are some breaking changes, so Swagger Parser hasn't been updated yet.

JamesMessinger avatar Feb 01 '16 17:02 JamesMessinger

Ah, excellent! Thank you for putting in the time.

hilkeheremans avatar Feb 02 '16 16:02 hilkeheremans

Swagger Parser v4.0 beta is now available, and includes the fix for this issue. You can install the beta using npm install swagger-parser@beta.

JamesMessinger avatar Apr 10 '16 16:04 JamesMessinger