cancel
Showing results for 
Search instead for 
Did you mean: 

Some Schemas in External Url in $ref do not resolve and shown as blank in the Response Schema

inauro
Occasional Contributor

Some Schemas in External Url in $ref do not resolve and shown as blank in the Response Schema

Hi, 

 

While documenting my API responses, I use $ref to point to a response format stored externally. Few of the formats like the one mentioned below do not resolve appropriately and are shown as blank in the Response Documentation section for that API. 

 

The documentation is as follows:

responses:
'200':
description: Success
content:
application/json:
schema:
$ref: 'https://perspiomodels.blob.core.windows.net/devicemodels/DeviceInfo.json'

 

inauro_0-1620889605955.png

The documentation corresponding to this is as shown (Empty):

inauro_1-1620889703886.png

Can you check and get back as soon as possible?

 

Thanks!

 


 

Tags (1)
3 REPLIES 3
inauro
Occasional Contributor

Re: Some Schemas in External Url in $ref do not resolve and shown as blank in the Response Schema

We are on Teams plan

HKosova
Moderator

Re: Some Schemas in External Url in $ref do not resolve and shown as blank in the Response Schema

Hi @inauro,

The schema keyword expects a schema definition, but the linked file is not a schema. Here's how you can define a schema for your response:

 

      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceInfo'  # <------

components:
  schemas:
    DeviceInfo:     # <------
      type: object
      properties:
        tenantId:
          type: string
          example: gf-d30caee4-5217-4731-9183-f1f2242f03ae
        assetInfo:
          type: object
          properties:
            ...
        deviceInfo:
          type: object
          properties:
            ...

 


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
inauro
Occasional Contributor

Re: Some Schemas in External Url in $ref do not resolve and shown as blank in the Response Schema

I tried with Open API Schema as well but same result. Schema not showing in the response. Can you check and let me know what needs to be corrected?

 

responses:
        '200':
          descriptionSuccess
          content:
            application/json:
              schema:
 
Asset Open API Schema Snippet 
inauro_0-1620964602596.png

 

 

Thanks!

New Here?
Join us and watch the welcome video:
Announcements