go-openapi / spec

openapi specification object model
Apache License 2.0
389 stars 98 forks source link

Expander: when expanding with SkipSchema, the relative path is lost #182

Closed fredbi closed 8 months ago

fredbi commented 8 months ago

When running ExpandSpec with the SkipSchema option, for $ref's in parameters or responses, relative paths when exploring multiple documents pointed by $ref is not properly maintained.

This happens when a ref-ed document in a folder refers to another doc via relative paths like "../folder".

In the attached example, the "working" spec SHOULD not work whereas the "not-working" spec SHOULD.

The "SkipSchema" option is used by the spec flattening feature exposed by go-openapi/analysis.

2743.zip

Original issue: go-swagger/go-swagger#2743

cc: @mateusbandeiraa