$ref external yaml file does not work
When reporting a bug, please provide the following details:
- swagger-ui master version
- a swagger file reproducing the issue I use the dist folder files in master, and use $ref to reference external yaml file, but it can't resolved. my yaml format is :
parameters:
-
name: request
in: body
required: true
schema:
$ref: './deviceManageDF.yaml#/definitions/AddDeviceDTONA2Cloud'
even modified with full acess path as:
parameters:
-
name: request
in: body
required: true
schema:
$ref: 'http://localhost:8080/swagger-ui/deviceManageDF.yaml#/definitions/AddDeviceDTONA2Cloud'
It displayed: http://localhost:8080/swagger-ui/deviceManageDF.yaml#/definitions/AddDeviceDTOCloud2NA is not defined!
are you hosting your swagger-ui or running it simply by opening the index.html?
Thanks. I am hosting my swagger-ui in my project with restful api services.
When running the hosted app, do you get the file when you open http://localhost:8080/swagger-ui/deviceManageDF.yaml in your browser or use curl?
Yes, I can open http://localhost:8080/swagger-ui/deviceManageDF.yaml in my brower
There is several REST interfaces in my index yaml file, and $ref to muti definition files. the ref to appSecurityDF.yaml#/definitions/RefreshTokenDTONA2Cloud is fine resolved, but ref to deviceManageDF.yaml#/definitions/AddDeviceDTONA2Cloud can't resoved.
It is the reason of https://github.com/swagger-api/swagger-ui/issues/2697