File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
packages/azure-functions-openapi-validator Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -66,11 +66,11 @@ setupValidation(openApiSpec, {
6666
6767This library uses the following keys for setting hook data, which can be used by other hooks or passed to your function handler.
6868
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
7272
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:
7474
7575``` ts
7676app .hook .preInvocation ((preContext : PreInvocationContext ) => {
Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ import {
1313import { AjvOpenApiValidator } from '@restfulhead/ajv-openapi-request-response-validator'
1414import { createJsonResponse , logMessage } from './helper'
1515
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'
1919
2020export interface ValidationMode {
2121 /** 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