Skip to content

Commit a4267e5

Browse files
committed
fix: Allow example keyword in AJV.
1 parent 6869327 commit a4267e5

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/validation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ function compileResponseValidationSchema() {
216216
allErrors: true
217217
});
218218
compiler.addSchema(Object.values(instance.getSchemas()));
219+
compiler.addKeyword('example');
219220
for (const [code, schema] of schemas) {
220221
validators[code] = compiler.compile(schema);
221222
}

src/validation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ export function compileResponseValidationSchema(this: FastifyInstance): void {
262262
})
263263

264264
compiler.addSchema(Object.values(instance.getSchemas()))
265+
compiler.addKeyword('example')
265266

266267
for (const [code, schema] of schemas) {
267268
validators[code] = compiler.compile(schema)

0 commit comments

Comments
 (0)