Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Handling $ref-s to external files (canonical dereferencing) #33

@bardzusny

Description

@bardzusny

Related: #20 .

This is feature request for being able to split swagger spec into several (or many...) files.

Right now we're able to reference only parameters available in the main (same) swagger spec file:

{
  "$ref": "#/definitions/myCar",
  "$ref": "#/parameters/myEngine"
}

What's lacking is possibility to reference external files, per http://json-schema.org/latest/json-schema-core.html#anchor30 :

{
  "$ref": "definitions.json#/myCar",
  "$ref": "parameters.json#/myEngine"
}

This would /greatly/ help to prevent main spec file from getting huge/hard to navigate.

Am I the only one who would want this? I already have some code laying around doing this, but outside of swaggerize-builder - basically just preprocessing .json file before it's passed on to it. I'm more than willing to try to package it into PR (probably extending current refresolver function in validator), but was also thinking about using some ready-made parsing library (couldn't find a good one though). Any ideas will be welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions