SwaggerUI 2.1.4 not able to resolve $ref under definitions

12 views
Skip to first unread message

Ritwik Chatterjee

unread,
Oct 14, 2016, 6:06:56 PM10/14/16
to Swagger
Hi,

My swagger file looks like the following:  

paths:
 
/ordercreate:

    post:
      parameters:
        - name: OrderCreateRQ
          in: body
          description: The OrderCreateRQ request body
          required: true
          schema:
            $ref: '#/
definitions/OrderCreateRQ'
      responses:
        200:
          description: Success response
          schema:
            $ref: '
#/definitions/OrderViewRS'


definitions
:
 
OrderCreateRQ:
    $ref
: './common/OrderCreateRQ.schema'


 
OrderViewRS:
    $ref
: './common/OrderViewRS.schema'

I do have the schemas in the "common" folder as valid JSON files. 
 
When I am pulling it up on SwaggerUI 2.1.4, it says:

./common/OrderCreateRQ.schema is not defined!
./common/OrderCreateRS.schema is not defined!



I have tried moving the schema files in the same directory and referring, but it fails. 
What am I missing here? Can someone help me?

Thanks
Ritwik 

Ritwik Chatterjee

unread,
Oct 14, 2016, 7:05:56 PM10/14/16
to Swagger
Please ignore, looks like a SwaggerUI issue. Got fixed in version 2.2.6
Reply all
Reply to author
Forward
0 new messages