swagger-api / swagger-api/swagger-ui

displayRequestDuration is not working as expected

Open
#5,665 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Q&A (please complete the following information)

  • OS: macOS
  • Browser: firefox for developers
  • Version: 71.0b1 (64-bit)
  • Method of installation: npm
  • Swagger-UI version: 3.24.0
  • Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration

Swagger-UI configuration options:

% cat swagger-config.yaml
---
url: "https://petstore.swagger.io/v2/swagger.json"
dom_id: "#swagger-ui"
validatorUrl: "https://validator.swagger.io/validator"
displayRequestDuration: true
% 
Describe the bug you're encountering

after adding displayRequestDuration to swagger-config.yaml as per the above and did the build using 'npm run build', and deployed new swagger-ui files:

The request duration is not showing when I use the try it out feature

To reproduce...

Steps to reproduce the behavior:

  1. Update file swagger-config.yaml to add "displayRequestDuration: true"
  2. run "npm run build"
  3. copy files under list/ directory to your website location
  4. Open your OAS and use try it out feature then check in the response and you would see that there is no "request duration" box.
Expected behavior

I expect that request duration section appears in try it out feature.

Screenshots
Screen Shot 2019-10-17 at 9 13 57 PM
Additional context or thoughts

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with swagger-config.yaml using displayRequestDuration: true, then run npm run build and inspect the generated files under the list/ directory. Use the Try It Out flow against the provided Petstore URL and compare the response view with the expected request duration section. Done means the duration is displayed after a request when the option is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.