stoplightio / http-spec

Utilities to normalize OpenAPI v2 and v3 objects for the Stoplight ecosystem.

Home Page:https://stoplight.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bundle refs when transforming documents(oas 2 and 3, postman collections, etc...)

pytlesk4 opened this issue · comments

User story.
When resolving documents in graphite, we bundle the data now. This can result in broken local refs for HTTP operations for example, because when we transform an oas operation to HTTP operations there could be a local ref that no longer exists anymore.

This is causing a lot of complexity in the export service for example, and other parts of stoplight as well. In the export service, because HTTP operations could have broken refs, we don't look them up. Instead, we look up the oas spec, get the transformed HTTP operation, and then bundle the refs.

Describe the solution you'd like
We should move the logic of bundling refs into HTTP-spec. We need to do this for any embedded resource that we work with.

For right now, I think that is HTTP operations and models(embedded JSON Schemas).

Related

https://github.com/stoplightio/platform-internal/pull/2892