Skip to content

Commit 24cdb94

Browse files
committed
chore: update keys
1 parent 3546263 commit 24cdb94

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/azure-functions-openapi-validator/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ setupValidation(openApiSpec, {
6666

6767
This 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
7676
app.hook.preInvocation((preContext: PreInvocationContext) => {

packages/azure-functions-openapi-validator/src/validation-hook-setup.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import {
1313
import { AjvOpenApiValidator } from '@restfulhead/ajv-openapi-request-response-validator'
1414
import { 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

2020
export interface ValidationMode {
2121
/** whether to return an error response in case of a validation error instead of the actual function result */

0 commit comments

Comments
 (0)