-
-
A human-readable description of what this API does. It is only used when
automatically generating the Swagger documentation for the API.
When used with the Swagger docs, newlines will be replaced with a single
space character. May use Markdown formatting.
-
-
The API's human-readable name.
By default, this is computed by de-camel-casing the class name.
-
-
The HTTP path suffix used to request this API.
-
protected, static swaggerSecurityConfig
-
-
-
The Schema describing the request body this API handles. Note that
GET requests should not have request bodies. Use HTTP POST requests if
request data size is too big to fit in the query string.
-
-
The header(s) which are allowed in CORS requests.
-
-
The hostname from which this API can be called in a browser. By default
this API cannot be called from a browser due to CORS policy (combined with
the fact that no web application runs on our API subdomain).
-
-
Errors that may be returned from the API. Errors are subclasses
of RequestError.
-
-
The Schema describing the HTTP headers this API handles, if any.
-
-
Whether to log request body to Sentry when error.
For API with sensitive user data, this shouldn't set to true.
-
-
The HTTP method used to request this API (e.g., GET, POST).
-
-
The Schema describing the path params this API handles, if any.
-
-
The Schema describing the query string this API handles, if any.
-
-
The schema describes the response body. This is used to verify that the
implementation produces a correctly shaped output. It also speeds up JSON
output serialization by 10-20%.
This can return one of two things:
1) {@see ResponseSchema} - responses with HTTP 200 status codes
will be validated against this schema. Non-200 responses can be
anything. This is the typical return value.
2) A subclass of {@see RequestDone}.
The default is to not allow any output on HTTP 200 responses.
-
-
Tag used to group APIs in the generated Swagger documentation. Set to null
to exclude it from the generated Swagger documentation.
-
static getInputsToTrackWithSentry()
-
Returns a map of inputs to track in Sentry's context.
By default, includes the query string, path params and body. This provides
helpful debugging information but should only be
used if these fields don't include sensitive information.
-
-
Adds inputs from the query string, path params and body to the Sentry
context. This provides helpful debugging information but should only be
used if these fields don't include sensitive information.
-
async, abstract, protected computeResponse(req) → {Object|String}
-
The API logic. This method is called after all inputs are validated
according to the schemas specified by the API definition.
Parameters:
| Name |
Type |
Description |
req |
Request
|
the fastify request object being handled |
Returns:
Object
|
String
- optional JSON-able object or string to send back
as the HTTP response body
-
-
Gets headers from this request that should be forwarded.
By default, this is all headers defined in HEADERS.
-
protected redirectToWebApp(schemeAndHostopt, pathopt, qsParamsopt, cookieopt)
-
Redirects to a URL optionally with query string and cookie.
Any headers to forward (that were sent to the request which is calling
this function) will be added to the existing cookie's JSON data, if any.
Parameters:
| Name |
Type |
Attributes |
Description |
schemeAndHost |
String
|
<optional>
|
e.g., https://my-webapp.example.com |
path |
String
|
<optional>
|
the version of the web application to launch;
can be overridden by query parameter "version" but otherwise defaults to
the version of the service which served the web app |
qsParams |
Object
|
<optional>
|
the query string parameters to launch with |
cookie |
Object
|
<optional>
|
cookie data to send (good for sensitive values
which should not be passed in the query string) |
-
-
Sets context to be transmitted to Sentry if this request fails.
-
-
Sets a tag to be transmitted to Sentry if this request fails.
-
-
Sets user info to be transmitted to Sentry if this request fails.