Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultPackageName = "openapi"
DefaultPackageName used in the router's source code
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate writes a chi router source code into `router` reading the YAML definition of the Open API 3.0 spec from the `specFile`. It supports options `opts` (see `Options`).
All included into generation endpoints must have `operationId` and `x-handler-group` attributes. Depending on the `opts` generator will either produce an error or skip endpoints without these attributes.
Types ¶
type Options ¶
type Options struct { // PackageName of the generated router source code (`DefaultPackageName` by default) PackageName string // FailNoGroup if true the generator returns an error if an endpoint without // `x-handler-group` attribute was found. Otherwise, this endpoint will be skipped silently. FailNoGroup bool // FailNoOperationID if true the generator returns an error if an endpoint without // `operationId` attribute was found. Otherwise, this endpoint will be skipped silently. FailNoOperationID bool }
Options represent all the possible options of the generator
Click to show internal directories.
Click to hide internal directories.