Open
Description
Q&A (please complete the following information)
- OS: Linux
- Browser: firefox,chrom
- Version: 88.0 (64-bit)
- Method of installation: maven (scala tapir library dependency)
- Swagger-UI version: 3.45.0
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
Example Swagger/OpenAPI definition:
openapi: 3.0.3
info:
title: The tapir library
version: 1.0.0
paths:
/books/list/all:
get:
operationId: getBooksListAll
responses:
'200':
description: ''
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Book'
/books/add:
post:
operationId: postBooksAdd
requestBody:
description: The book to add
content:
application/json:
schema:
$ref: '#/components/schemas/Book'
example:
title: Pride and Prejudice
year: 1813
author:
name: Jane Austen
required: true
responses:
'200':
description: ''
components:
schemas:
Book:
required:
- title
- year
- author
type: object
properties:
title:
type: string
year:
type: integer
author:
$ref: '#/components/schemas/Author'
Author:
required:
- name
type: object
properties:
name:
type: string
Swagger-UI configuration options:
SwaggerUIBundle({
url: "https://petstore.swagger.io/v2/swagger.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});
Query string options
?url=/admin/docs/docs.yaml&displayRequestDuration=true
Describe the bug you're encountering
after adding displayRequestduration
to swagger query parameters: displayRequestDuration=true
as per above, I can see request duration, however time shown is far from what other means of measurements calculated.
The request duration is not correctly calculated.
To reproduce...
Steps to reproduce the behavior:
- Install and run sample akka-http project with tapir. I will use this one as an example: sample-project
- Go to localhost.swagger-ui.html with
displayRequestDuration=true
already appended in query parameters. Try it out
on/books/list/all
endpoint.- See request duration
- Use the same query with other tools like Postman or CURL
- See the difference in request duration times
Expected behavior
I expect time to be at least similar (not 4 or 5 times higher) to the time shown by Postman or CURL.
Screenshots
Swagger
Postman
In-application metrics
Additional context or thoughts
Maybe the time that I see is, somehow, correct? If so, please let me know how should I interpret it.