Skip to content

Commit a89f950

Browse files
committed
post-rebase fixes
1 parent 04cbbfb commit a89f950

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/examples/client/simpleStreamableHttp.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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
2222
const 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) {

src/server/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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

3839
export 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);

0 commit comments

Comments
 (0)