File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import {
16
16
ResourceListChangedNotificationSchema ,
17
17
ElicitRequestSchema ,
18
18
} from '../../types.js' ;
19
- import { Ajv } from ' ajv' ;
19
+ import Ajv from " ajv" ;
20
20
21
21
// Create readline interface for user input
22
22
const readline = createInterface ( {
@@ -215,7 +215,7 @@ async function connect(url?: string): Promise<void> {
215
215
const required = schema . required || [ ] ;
216
216
217
217
// Set up AJV validator for the requested schema
218
- const ajv = new Ajv ( { strict : false , validateFormats : true } ) ;
218
+ const ajv = new Ajv ( ) ;
219
219
const validate = ajv . compile ( schema ) ;
220
220
221
221
let attempts = 0 ;
@@ -352,7 +352,7 @@ async function connect(url?: string): Promise<void> {
352
352
if ( ! isValid ) {
353
353
console . log ( '❌ Validation errors:' ) ;
354
354
validate . errors ?. forEach ( error => {
355
- console . log ( ` - ${ error . instancePath || 'root' } : ${ error . message } ` ) ;
355
+ console . log ( ` - ${ error . dataPath || 'root' } : ${ error . message } ` ) ;
356
356
} ) ;
357
357
358
358
if ( attempts < maxAttempts ) {
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ import {
33
33
ServerResult ,
34
34
SUPPORTED_PROTOCOL_VERSIONS ,
35
35
} from "../types.js" ;
36
- import { Ajv } from "ajv" ;
36
+ import Ajv from "ajv" ;
37
+ import type { ValidateFunction } from "ajv" ;
37
38
38
39
export type ServerOptions = ProtocolOptions & {
39
40
/**
@@ -321,7 +322,7 @@ export class Server<
321
322
// Validate the response content against the requested schema if action is "accept"
322
323
if ( result . action === "accept" && result . content ) {
323
324
try {
324
- const ajv = new Ajv ( { strict : false , validateFormats : true } ) ;
325
+ const ajv = new Ajv ( ) ;
325
326
326
327
const validate = ajv . compile ( params . requestedSchema ) ;
327
328
const isValid = validate ( result . content ) ;
You can’t perform that action at this time.
0 commit comments