Forum Discussion

jonpp's avatar
jonpp
Regular Visitor
6 years ago

Create API Definition does not always generate complete response section

Trying to document an existing API by querying in Inspector and then using Create API Definition.  All the endpoints return valid JSON, but after pulling into HUB only some have a "good" response section.  I'm a new user and not sure if this is the expected behavior.  Is there anything I could change to ensure the response is fully included in the created API definition?

 

Below are the response sections generated for three different queries.  The generated spec is always the same for a given endpoint.

 

Sometimes there's nothing (query to swapi.co/api/people)

 

      responses:
        '200':
          description: Auto generated using Swagger Inspector

 

Often it thinks the JSON object is a string with no contents (query to our corporate API)

 

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

Sometimes it works (query to swapi.io/api/people/1)

 

 

responses:
        '200':
          description: Auto generated using Swagger Inspector
          content:
            application/json:
              schema:
                type: object
                properties:
                  films:
                    type: array
                    items:
                      type: string
                  homeworld:
                    type: string
                  gender:
                    type: string
                  skin_color:
                    type: string
                  edited:
                    type: string
                  created:
                    type: string

 

 

No RepliesBe the first to reply