validator-badge
validator-badge copied to clipboard
Validator does not validate relative references
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'
Yeah, we recently encountered that issue. Thanks for opening a ticket.
Is there a time frame for this to be complete?
This is a problem for me as well.
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.
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'