mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
* WIP * Gen * WIP * chi swagger * WIP * WIP * WIP * GetWorkspaces * GetWorkspaces * Markdown * Use widdershins * WIP * WIP * WIP * Markdown template * Fix: makefile * fmt * Fix: comment * Enable swagger conditionally * fix: site * Default false * Flag tests * fix * fix * template fixes * Fix * Fix * Fix * WIP * Formatted * Cleanup * Templates * BEGIN END SECTION * subshell exit code * Fix * Fix merge * WIP * Fix * Fix fmt * Fix * Generic api.md page * Fix merge * Link pages * Fix * Fix * Fix: links * Add icon * Write manifest file * Fix fmt * Fix: enterprise * Fix: Swagger.Enable * Fix: rename apidocs to apidoc * Fix: find -not -prune * Fix: json not available * Fix: rename Coderd API to Coder API * Fix: npm exec * Fix: api dir * Fix: by ID * Fix: string uuid * Fix: include deleted * Fix: indirect go.mod * Fix: source lib.sh * Fix: shellcheck * Fix: pushd popd * Fix: fmt * Fix: improve workspaces * Fix: swagger-enable * Fix * Fix: mention only HTTP 200 * Fix: IDs * Fix: https * Fix: icon * More APis * Fix: format swagger.json * Fix: SwaggerEndpoint * Fix: SCRIPT_DIR * Fix: PROJECT_ROOT * Fix: use code tags in schemas.md * Fix: examples * Fix: examples * Fix: improve format * Fix: date-time,enums * Fix: include_deleted * Fix: array of * Fix: parameter, response * Fix: string time or null * Workspaces: more docs * Workspaces: more docs * Fix: renderDisplayName * Fix: ActiveUserCount * Fix * Fix: typo * Templates: docs * Notice: incomplete
Swagger / OpenAPI 2 and OpenAPI 3 template parameters
Note that properties of OpenAPI objects will be in OpenAPI 3.0 form, as Swagger / OpenAPI 2.0 definitions are converted automatically.
Code templates
method- the HTTP method of the operation (in lower-case)methodUpper- the HTTP method of the operation (in upper-case)url- the full URL of the operation (including protocol and host)consumes[]- an array of MIME-types the operation consumesproduces[]- an array of MIME-types the operation producesoperation- the current operation objectoperationId- the current operation idopName- the operationId if set, otherwise the method + pathtags[]- the full list of tags applying to the operationsecurity- the security definitions applying to the operationresource- the current tag/path objectparameters[]- an array of parameters for the operation (see below)queryString- an example queryString, urlEncodedrequiredQueryString- an example queryString forrequired:trueparametersqueryParameters[]- a subset ofparametersthat arein:queryrequiredParameters[]- a subset ofqueryParametersthat arerequired:trueheaderParameters[]- a subset ofparametersthat arein:headerallHeaders[]- a concatenation ofheaderParametersand pseudo-parametersAcceptandContent-Type, and optionallyAuthorization(the latter has anisAuthboolean property set true so it can be omitted in templates if desired
Parameter template
parameters[]- an array of parameters, including the following pseudo-propertiesshortDesc- a truncated version of the parameter descriptionsafeType- a computed version of the parameter type, including Body and schema namesoriginalType- the original type of the parameterexampleValues- an object containing examples for use in code-templatesjson- example values in JSON compatible syntaxobject- example values in raw object form (unquoted strings etc)
depth- a zero-based indicator of the depth of expanded request body parameters
enums[]- an array of (parameter)name/value pairs
Responses template
responses[]- an array of responses, includingstatusandmeaningproperties
Authentication template
authenticationStr- a simple string of methods (and scopes where appropriate)securityDefinitions[]- an array of applicable securityDefinitions
Schema Property template
schemaProperties[]- an array ofnametyperequireddescription
enums[]- an array of (schema property)name/value pairs
Common to all templates
openapi- the top-level OpenAPI / Swagger documentheader- the front-matter of the Slate/Shins markdown documenthost- the (computed) host of the APIprotocol- the default/first protocol of the APIbaseUrl- the (computed) baseUrl of the API (including protocol and host)widdershins- the contents of widdershinspackage.json