v0.1.0OpenAPI 3.1.0

oaspect server API

Endpoints
2
Groups
1
Models
4

The request contract of oaspect/server's handlers, as an OpenAPI document rendered by oaspect itself. For installation, configuration and guides, read the documentation.

Server helpers

Web-standard Request → Response handlers from oaspect/server.

Relay a "Try" request

post/proxy

operationId: proxy

What the viewer posts to proxyUrl. createProxyHandler({ allowedHosts }) sends the request from the server and returns the response.

Request body

required
methodstring
Default: "GET"
Example: "POST"
urlstring<uri>required
headersobject
bodystring

Text body (JSON

array<FormPart>

multipart/form-data parts; files are base64-encoded.

Responses

statusinteger
Example: 200
statusTextstring
Example: "OK"
headersarray<array<string>>
bodystring
durationinteger

Milliseconds.

Serve the OpenAPI document

get/openapi

operationId: spec

createSpecHandler({ url, fallback }): fetches the live document server-side and caches it; serves the fallback when it cannot be reached.

Responses

Headers

x-oaspect-spec-sourcestring

remote, fallback (the viewer shows an out-of-date notice) or static.

Values:"remote""fallback""static"
object

Models

ProxyRequest

methodstring
Default: "GET"
Example: "POST"
urlstring<uri>required
headersobject
bodystring

Text body (JSON

array<FormPart>

multipart/form-data parts; files are base64-encoded.

FormPart

namestringrequired
valuestring
object

ProxyResponse

statusinteger
Example: 200
statusTextstring
Example: "OK"
headersarray<array<string>>
bodystring
durationinteger

Milliseconds.

Error

errorstring
Example: "api.internal is not an allowed host."