Skip to content

Commit

Permalink
Add security requirements type to root document
Browse files Browse the repository at this point in the history
  • Loading branch information
xsalazar committed Jul 24, 2021
1 parent b83320b commit 242e2ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.d.ts
Expand Up @@ -112,6 +112,14 @@ declare namespace hapiswagger {
[key: string]: any;
}

/**
* Lists the required security schemes to execute this operation. The object can have multiple security schemes declared in it which are all required (that is, there is a logical AND between the schemes)
* The name used for each property MUST correspond to a security scheme declared in the {@link RegisterOptions.securityDefinitions}
*/
type SecurityRequirementsType = {
[securityDefinitionName: string]: [string]
}

interface LicenseOptions {
/**
* The name of the license used for the API
Expand Down Expand Up @@ -439,6 +447,11 @@ declare namespace hapiswagger {
* A declaration of the security schemes available to be used in the specification. This does not enforce the security schemes on the operations and only serves to provide the relevant details for each scheme
*/
securityDefinitions?: {[name: string]: SecuritySchemeType}

/**
* A declaration of which security schemes are applied for the API as a whole. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements)
*/
security?: [SecurityRequirementsType]
}
}

Expand Down
1 change: 1 addition & 0 deletions optionsreference.md
Expand Up @@ -35,6 +35,7 @@
- `grouping`: (string) how to create grouping of endpoints value either `path` or `tags` - default: `path`
- `tagsGroupingFilter`: (function) A function used to determine which tags should be used for grouping (when `grouping` is set to `tags`) - default: `(tag) => tag !== 'api'`
- `securityDefinitions:`: (object) Containing [Security Definitions Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#securityDefinitionsObject). No defaults are provided.
- `security`: (array) Containing [Security Requirement Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#securityRequirementObject). No defaults are provided.
- `payloadType`: (string) How payload parameters are displayed `json` or `form` - default: `json`
- `documentationRouteTags`: (string or array) Add hapi tags to internal `hapi-swagger` routes - default: `[]`
- `documentationRoutePlugins`: (object) Add hapi plugins to internal `hapi-swagger` routes - default: `{}`
Expand Down

0 comments on commit 242e2ac

Please sign in to comment.