Forum Discussion

ExH's avatar
ExH
New Contributor
4 years ago

Execute not working

Hi there, 

 

I'm  very new to Swagger and I've been following the documentation which appears to be working on a very simple API.

 

However, when I go to test the API call nothing happends. I press the 'Execute' button, I see the spinner then, nothing. 

 

I've checked the Network tab and I can see the request and the response which look fine. 

 

Any advice on how I can fix this?

 

Thanks

 

Ed

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Hi Ed,

     

    Please post the OpenAPI definition (YAML/JSON file) you're using. Do you test the requests from Swagger UI or Swagger Editor? Are there any errors on the Console tab in the browser dev tools?

    • ExH's avatar
      ExH
      New Contributor

      Hi there,

       

      I'm using swaggerJsDoc and swagger-ui-express mainly because I found some tutorials on how to use them. 

       

      No errors are coming up in the Swagger UI or in the console. The response is coming back "200" and I can see the correct response.

       

      This is one example of the schemes I've created:

       

      /**
       * @swagger
       *  components:
       *    schemas:
       *      abc:
       *        type: object
       *        required:
       *         - vQty
       *         - scope
       *         - growth
       *         - usePerV
       *        properties:
       *          vQty:
       *            type: integer
       *            description: VQuantity
       *          scope:
       *            type: integer
       *            description: Years in scope
       *          growth:
       *            type: number
       *            format: float
       *            description: Growth per-year
       *          usePerV:
       *            type: boolean
       *            description: Use Per-V files
       *        example:
       *          vQty: 200
       *          scope: 3
       *          growth: 0.2
       *          usePerV: true
       *      abcResponse:
       *        type: object
       *        properties:
       *          abcServer:
       *            type: object
       *            properties:
       *              jobs: 
       *                type: number
       *                format: float
       *                description: Job quantity
       *              buCores:
       *                type: number
       *                format: float
       *                description: BServer C
       *              buRam:
       *                type: number
       *                format: float
       *                description: BServer R
       *          dbServer:
       *            type: object
       *            properties:
       *              sCores:
       *                type: number
       *                format: float
       *                description: SServer C   
       *              sRam:
       *                type: number
       *                format: float
       *                description: SServer R
       */
       
      And the paths
       
      /**
       * @swagger
       * paths:
       *   /vServer:
       *     post:
       *       summary: Returns the VBR and SQL calculation
       *       tags: [abc]
       *       requestBody:
       *         required: true
       *         content:
       *           application/json:
       *             schema:
       *               $ref: '#/components/schemas/abc'
       *     responses:
       *       "200":
       *         description: OK
       *         content:
       *           application/json:
       *             schema:
       *               $ref: '#/components/schemas/abcResponse'
       */
       
      Any help would be appreciated.
       
      Ed