swagger-parser icon indicating copy to clipboard operation
swagger-parser copied to clipboard

$ref does not work

Open zcb22000 opened this issue 9 years ago • 3 comments

I used swagger-parser-1.0.25.jar which to parser my yaml file with yaml spec 2.0. But it doesn't parser the $ref content where resolved as empty. Swagger swagger = new SwaggerParser().read("src/main/resources/yaml/index.yaml"); My yaml file partition content is: `paths: $ref: ./paths/index.yaml

definitions: $ref: ./definitions/definitions.yaml` The paths and definitions are empty in swagger Object which parsered but the $ref specified files are not empty. Why?

zcb22000 avatar Jan 18 '17 03:01 zcb22000

See my issue: https://github.com/swagger-api/swagger-parser/issues/346

RobWin avatar Jan 19 '17 07:01 RobWin

See here:

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md

That's not legal in the spec, and therefore not supported in the parser.

fehguy avatar Jan 19 '17 07:01 fehguy

OK, Thanks

zcb22000 avatar Jan 20 '17 08:01 zcb22000