cancel
Showing results for 
Search instead for 
Did you mean: 

Swagger Inspector Generated API Definition fails to produce schema for JSON Body response

Highlighted
New Contributor

Swagger Inspector Generated API Definition fails to produce schema for JSON Body response

Swagger Inspector API Documentation generator does not generate JSON schema.  I execute my request, receive the response which contains a relatively complex JSON body(see attached screenshot). When I generate the API doc and view it in SwaggerHub, the produced schema only shows a type string instead of a structured JSON object.(See attached screenshot)

 

 

     responses:
        '200':
          description: Auto generated using Swagger Inspector
          content:
            application/json;charset=utf-8:
              schema:
                type: string
              examples: {}

 

Screen Shot 2020-10-29 at 4.53.36 PM.png

Screen Shot 2020-10-29 at 4.52.52 PM.png

Screen Shot 2020-10-29 at 4.52.44 PM.png

   

2 REPLIES 2
Highlighted
New Contributor

Re: Swagger Inspector Generated API Definition fails to produce schema for JSON Body response

Adding further details. When I chose OAS2 instead of OAS3, it works. So I would tend to say, we have a problem with OAS3 API Generation.

definitions:
  Query:
    properties:
      l:
        type: string
      LocationQuery:
        type: string
      sessionToken:
        type: string
  Model0:
    properties:
      query:
        $ref: '#/definitions/Query'
      Query:
        type: string
  Id:
    properties:
      lodgingSelection:
        type: string
      Id:
        type: string
  TrackingProperties:
    properties:
      google_place_id:
        type: string
      google_place_description:
        type: string
      google_place_types:
        type: array
        items:
          type: string
  Results:
    properties:
      id:
        $ref: '#/definitions/Id'
      label:
        type: string
      trackingProperties:
        $ref: '#/definitions/TrackingProperties'
      opaqueProperties:
        type: string
  Categories:
    properties:
      category:
        type: string
      label:
        type: string
      results:
        type: array
        items:
          $ref: '#/definitions/Results'
  Response:
    properties:
      categories:
        type: array
        items:
          $ref: '#/definitions/Categories'
  Model1:
    properties:
      updates:
        type: array
      response:
        $ref: '#/definitions/Response'
      AppResponse:
        type: string

Screen Shot 2020-10-30 at 8.56.23 AM.png

Highlighted
Moderator

Re: Swagger Inspector Generated API Definition fails to produce schema for JSON Body response

Hi @araby, please report this issue to support (if not already):

https://support.smartbear.com/message/?prod=SwaggerHub

 


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video: