Forum Discussion

francen's avatar
francen
New Contributor
6 years ago

Creating a skeleton for documenting response schema

Hi, I am looking for something that helps me documenting an existing API. It seems that swaggerhub only ever generates a "description: Auto generated using Swagger Inspector" and does not analyse the response.

Does a tool exist that generates a schema skeleton from a response ?
Something that, from a response of:

Pets: [{
  name: 'bobby',
  type: 'dog'
}]

would generate something like:

components:
  schemas:
    xx123:
      properties:
        name:
          type: string
        type:
          type: string
    Pets:
      type: array
      items:
        $ref: "#/components/schemas/xx123"

 

  • Hi Francen,

     

    There is an open enhancement request in SwaggerHub to create requests and responses from JSON schema definitions in a Swagger\OAS3 spec.  This enhancement sounds similar to what you are asking for.  I will let you know when this enhancement has been implemented.

     

    Regards,

    Marcus

    SmartBear Support

    • francen's avatar
      francen
      New Contributor

      What you describe goes the opposite way of what I am looking for. I would like somethoing that generates a schema definition from a response.

      • MarcusJ's avatar
        MarcusJ
        Moderator

        Hi Francen,

         

        I will create an enhancement request for this.

         

        Regards,

        Marcus

        SmartBear Support