validator-badge icon indicating copy to clipboard operation
validator-badge copied to clipboard

Validator does not validate relative references

Open jeff9finger opened this issue 9 years ago • 5 comments

I have a swagger file like the following. It validates correctly when the referenced yaml file (abc.yaml) is not valid.

swagger: '2.0'
info:
  version: '2.0'
  title: ABC API

consumes:
  - application/json
produces:
  - application/json
paths:
  /abc:
    $ref: 'paths/abc.yaml'

jeff9finger avatar Mar 11 '16 21:03 jeff9finger

Yeah, we recently encountered that issue. Thanks for opening a ticket.

webron avatar Mar 11 '16 21:03 webron

Is there a time frame for this to be complete?

jeff9finger avatar Mar 21 '16 17:03 jeff9finger

This is a problem for me as well.

denarced avatar Aug 28 '18 06:08 denarced

You could use my tool openapi-preprocessor to build a single file spec for publication. That will help users of your spec who use tools that do not fully implement the Swagger/OpenAPI spec such as this validator.

dolmen avatar Jan 24 '19 10:01 dolmen

Any progress on this? In my case, the validation is correct, although the referenced file does not exist (there is typo in the name).

components:
  schemas:
    Treatment:
      description: blabla
      type: object
      properties:
        ageAtOnset:
          $ref: 'ccommon.yaml#/components/schemas/Age'

sdelatorrep avatar Mar 03 '21 11:03 sdelatorrep