Closed tuexss closed 7 years ago
see https://github.com/swagger-api/swagger-spec/blob/master/guidelines/REUSE.md#parameters for how it's done
@tuexss yes, it's true that it doesn't support this yet, and probably will be hard to manage due to app sandboxing, I suggest that as you said, you run the Swagger file through a preprocessor to embed all files, I'm not sure if that exists
did some quick search and couldn't find something that does that, but I found a few other libs/tools that don't support external references, so a "external reference flattener" would be super userful
ok, thanks for the feedback, will think about it.
had the same issue. I'm using swagger-cli as a preprocessor: install swagger-cli:
npm install -g swagger-cli
and then run swagger on the root yml file:
swagger bundle -r <root.yml>
importing works!
@nosyjoe oh great, thanks for the tip! I'll add this to our Paw documentation until this issue is fixed
Actually, to be more precise:
$ref: "#/folder/secondfile.yml"
would not resolve to a different file as per the JSON pointer RFC used by swagger, but to a path within the current file.
A URI fragment falling under this issue would be
$ref: "/folder/secondfile.yml#/path/to/definition/in/schema"
more info on URIs
@tuexss The latest release of paw (paw 3.1) and the latest release of the swagger importer (SwaggerImporter v3.0.2) should fix this 2-year old issue.
@JonathanMontane i'm coming to the same point , where i have a json swagger referencing other json schema files.
any documentation ? i'd like to understand the workflow for getting that working please
thanks in advance,
Our swagger description is spread across several .yml-files, using something like
to pull in the real data. But this importer can only take a single file and doesn't follow the references. Would it make sense to add this as a feature, or is there some kind of tool I could use as preprocessor before the import?