File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import {
1616 ResourceListChangedNotificationSchema ,
1717 ElicitRequestSchema ,
1818} from '../../types.js' ;
19- import { Ajv } from ' ajv' ;
19+ import Ajv from " ajv" ;
2020
2121// Create readline interface for user input
2222const readline = createInterface ( {
@@ -215,7 +215,7 @@ async function connect(url?: string): Promise<void> {
215215 const required = schema . required || [ ] ;
216216
217217 // Set up AJV validator for the requested schema
218- const ajv = new Ajv ( { strict : false , validateFormats : true } ) ;
218+ const ajv = new Ajv ( ) ;
219219 const validate = ajv . compile ( schema ) ;
220220
221221 let attempts = 0 ;
@@ -352,7 +352,7 @@ async function connect(url?: string): Promise<void> {
352352 if ( ! isValid ) {
353353 console . log ( '❌ Validation errors:' ) ;
354354 validate . errors ?. forEach ( error => {
355- console . log ( ` - ${ error . instancePath || 'root' } : ${ error . message } ` ) ;
355+ console . log ( ` - ${ error . dataPath || 'root' } : ${ error . message } ` ) ;
356356 } ) ;
357357
358358 if ( attempts < maxAttempts ) {
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ import {
3333 ServerResult ,
3434 SUPPORTED_PROTOCOL_VERSIONS ,
3535} from "../types.js" ;
36- import { Ajv } from "ajv" ;
36+ import Ajv from "ajv" ;
37+ import type { ValidateFunction } from "ajv" ;
3738
3839export type ServerOptions = ProtocolOptions & {
3940 /**
@@ -321,7 +322,7 @@ export class Server<
321322 // Validate the response content against the requested schema if action is "accept"
322323 if ( result . action === "accept" && result . content ) {
323324 try {
324- const ajv = new Ajv ( { strict : false , validateFormats : true } ) ;
325+ const ajv = new Ajv ( ) ;
325326
326327 const validate = ajv . compile ( params . requestedSchema ) ;
327328 const isValid = validate ( result . content ) ;
You can’t perform that action at this time.
0 commit comments