Skip to content

Ability to skip dereferencing inline/internal $ref values #214

@denver-HJS

Description

@denver-HJS

Hi all,

@stoplight/json-ref-resolver offers options to skip dereferencing either internal or remote references. I've found this feature to be very useful, but now that project is now deprecated and points to this one.

I was wondering if there's already a way to accomplish the same thing using this library?

Essentially I'm hoping to preserve this behavior of taking an example schema:

{
   "paths": {
     "/awesome/endpoint": {
       "post": {
          "responses": {
            "400": {
              "$ref": "#/components/responses/400"
            }
          }
       }
     }
   },
   "components": {
     "responses": {
       "400": {
         "$ref": "https://example.com/path/to/my/oas/file.oas3.json#/components/responses/400"
     }
  }
}

and only dereference the remote HTTP reference:

{
   "paths": {
     "/awesome/endpoint": {
       "post": {
          "responses": {
            "400": {
              "$ref": "#/components/responses/400"
            }
          }
       }
     }
   },
   "components": {
     "responses": {
       "400": {
         "description": "The request syntax was malformed and could not be processed.",
          "content": {
             "application/json": {
                "type": "object",
                "properties": {
                  "statusCode": {
                    "type": "integer"
                  },
                  "message": {
                    "type": "string"
                  }
                }
             }
          }
       }
   }
}

@P0lip sorry to ping you directly, but I noticed that you've been active in both projects. If you have any pointers it would be much appreciated.

Hopefully this summary makes sense. Thanks!

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