-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Describe expected response times for responses #3063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That's an interesting idea. I guess it would make sense to put it under either operation or server, you could use description or add a custom attribute e.g. The only problem is, there can always be a delay on the way, so if the operation, including the network transmission, takes 101ms, and client developer imposes that 100ms as a timeout, they lose the response. The typical default timeout is 30sec for the reason that the internet doesn't guarantee response times. |
My intention isn't to fail the response but more use it as a hint. Ie. when the request hits the API to the backend and back - that's the time I'm interested in hinting at. Other actors can then infer expected behaviour. It would eliminate false callouts as I can see that actually, the dev intended it to take 5 seconds so no point in moaning that it is taking 3. |
@rafalkrupinski how do I progress this? Can this be achieved now and if so, how? If not possible today, I'm more than happy to jump on calls / present this proposal. Just let me know where and when and I'll turn up. Looking forward to PoCing htis if it is possible (I'm an OpenAPI newbie so a noob guide would be great for me :) ) |
@agardnerIT How you support timeouts depends on your tooling. If the client is coded by hand, you can either use an extension or simply the description field and let the client developer handle it in their code. It's also a matter of how you create the schema. If it's generated from the server code, it also needs to support adding extension fields. |
I would start by suggesting some |
Thanks. |
I join this request We're working on a framework that reads many information from a mandatory Open API specification file including:
We also have mandatory response time requirements that we need to enforce in the specification as all routes don't have the same response time criticity based on business use cases. I take this occasion to remind that this request also exists in fact in a still opened issue from 2016 ;-)
As no-standard field exists yes in OAS, we'll for sure start defining a vendor specific We expect such field, once standardized, to be interpreted & used by:
Moreover we could define rules in tools like Spectral to expect a 408 response from routes that define such timeout to detect such kind of potential issues before running service contact tests |
Does any of the open-source tools you've mentioned support timeout via a x- property so far? |
I still have to dig The first I can mention is the
On its side Apigee natively handles different types of timeouts in its products, but while you can publish Open API based services, their timeouts cannot be defined through that Open API specification. It only supports standard Open API fields |
Costs CodesSuggestions:
ExamplesEndpoint EvaluationI have a system which calls a third party API. I am evaluating between two different third parties for this APIs. All the usual SLOs apply (response time etc.) but cost is also a major factor. If Direct cost trackingIf I have the above, my tooling can aggregate the header data and show: You have spent Different Definitions of CostCost of course can be monetary, but a "cost" could also indicate other quantities (like a carbon emissions costs). |
Doesn't this fall apart once proxy/reverse-proxy servers enter into the picture? They can add to a response time which can't be tracked by the application returning the header, and the client will not be able to tell apart a proxy/app response of |
I can describe expected return codes, response types and even expected responses via the spec: https://swagger.io/docs/specification/describing-responses/
What I feel is missing right now is the ability to document expected response times. As a developer, I know my endpoint should return in
<100ms
with a201
.Is there a way to achieve this today (perhaps via some custom annotation?) or would this require a spec update. If so, how do I formally submit that as a request?
The text was updated successfully, but these errors were encountered: