You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'll use a simple endpoint as an example: GET /orders/{id} which requires authentication.
By default, Scribe will create an example value, and this value will be added to the Try it out form's id input.
The problem is that the user probably doesn't have access to this random order id, so the default Try it out request will result in a 403 error.
The logical solution to this is to add No-example to this parameter, to avoid having the form filled with an invalid id.
But this leads to a different issue. If the user doesn't enter a value for id, the request is sent to a completely different endpoint: /orders.
This could be solved by adding some very simple client-side validation to the Try it out form. I imagine it would be enough to add required to the relevant inputs, and check if the native browser validation passes before sending the request.
The text was updated successfully, but these errors were encountered:
We used to add required for required fields in the past, but I changed it. The reason: sometimes the user may want to see how the API responds when a parameter is missing. Obviously, for URL parameters, this takes you to a totally different URL, meaning it's not useful. So we can change that, but very low priority. PRs welcome.
I'll use a simple endpoint as an example:
GET /orders/{id}
which requires authentication.By default, Scribe will create an example value, and this value will be added to the Try it out form's
id
input.The problem is that the user probably doesn't have access to this random order id, so the default Try it out request will result in a 403 error.
The logical solution to this is to add
No-example
to this parameter, to avoid having the form filled with an invalid id.But this leads to a different issue. If the user doesn't enter a value for
id
, the request is sent to a completely different endpoint:/orders
.This could be solved by adding some very simple client-side validation to the Try it out form. I imagine it would be enough to add
required
to the relevant inputs, and check if the native browser validation passes before sending the request.The text was updated successfully, but these errors were encountered: