File tree 2 files changed +7
-7
lines changed
packages/azure-functions-openapi-validator
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -66,11 +66,11 @@ setupValidation(openApiSpec, {
66
66
67
67
This library uses the following keys for setting hook data, which can be used by other hooks or passed to your function handler.
68
68
69
- * ` azure-functions-openapi-validator_query -param-validation-error ` : An array of query parameter validation errors or undefined
70
- * ` azure-functions-openapi-validator_request -body-validation-error ` : An array of request body validation errors or undefined
71
- * ` azure-functions-openapi-validator_normalized -query-params ` : The coerced (if enabled) and normalized query params
69
+ * ` @restfulhead/ azure-functions-openapi-validator/query -param-validation-error` : An array of query parameter validation errors or undefined
70
+ * ` @restfulhead/ azure-functions-openapi-validator/request -body-validation-error` : An array of request body validation errors or undefined
71
+ * ` @restfulhead/ azure-functions-openapi-validator/normalized -query-params` : The coerced (if enabled) and normalized query params
72
72
73
- For example, if you enabled query parameter coercion (default), then coerced query parameters can be accesse by later hooks like so:
73
+ For example, if you enabled query parameter coercion (default), then coerced query parameters can be accesse by later hooks and functions like so:
74
74
75
75
``` ts
76
76
app .hook .preInvocation ((preContext : PreInvocationContext ) => {
Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ import {
13
13
import { AjvOpenApiValidator } from '@restfulhead/ajv-openapi-request-response-validator'
14
14
import { createJsonResponse , logMessage } from './helper'
15
15
16
- export const HOOK_DATA_QUERY_PARAM_VALIDATION_ERROR_KEY = 'azure-functions-openapi-validator_query -param-validation-error'
17
- export const HOOK_DATA_REQUEST_BODY_VALIDATION_ERROR_KEY = 'azure-functions-openapi-validator_request -body-validation-error'
18
- export const HOOK_DATA_NORMALIZED_QUERY_PARAMS_KEY = 'azure-functions-openapi-validator_normalized -query-params'
16
+ export const HOOK_DATA_QUERY_PARAM_VALIDATION_ERROR_KEY = '@restfulhead/ azure-functions-openapi-validator/query -param-validation-error'
17
+ export const HOOK_DATA_REQUEST_BODY_VALIDATION_ERROR_KEY = '@restfulhead/ azure-functions-openapi-validator/request -body-validation-error'
18
+ export const HOOK_DATA_NORMALIZED_QUERY_PARAMS_KEY = '@restfulhead/ azure-functions-openapi-validator/normalized -query-params'
19
19
20
20
export interface ValidationMode {
21
21
/** whether to return an error response in case of a validation error instead of the actual function result */
You can’t perform that action at this time.
0 commit comments