go-openapi / spec

openapi specification object model

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

spec ExpandSpec on circular $ref leaves absolute path in new $ref

fredbi opened this issue · comments

When running expand on a spec with a circular $ref, the resulting $ref is left with the full absolute path of the file.

Example: https://github.com/go-swagger/go-swagger/fixtures/canary/bitbucket.org/swagger.json

There are two circular $ref in this spec:

#/definitions/repository
#/definitions/base_commit

If I use expand fromthe swagger expand command, or independently from go-openapi/analysis/flatten(), the resolved circular $ref leaves the full absolute path of the file, instead of just #/definitions/...`

In both case, the RelativeBase expand option parameter is set to the absolute path of the spec file.

This is annoying when in go-openapi/analysis, we try to sort out $ref's which are plain definitions.