OpenAPI
Overview
@webroute/oas
provides utilities for building and consuming OpenAPI specs.
All @webroute/oas
functionality leverages the fantastic work by the
openapi3-ts
package.
Server-side
When creating our APIs, we add metadata to our schema, which is then interpreted by createSpec
, to enrich our OpenAPI specs without any awkward APIs.
Read more about decorators.
Inference
@webroute/oas
enables directly parsing an OpenAPI spec into useful typescript types, without any code generation.
This is primarily useful for generating typed clients, but can also be used to define backends up-front and implementing the routes thereafter.
Read more about type inference.