Skip to main content
Glama
requiresAjv.test.js1.06 kB
'use strict' const { test } = require('node:test') const build = require('..') test('nested ref requires ajv', async t => { t.test('nested ref requires ajv', async t => { const schemaA = { $id: 'urn:schema:a', definitions: { foo: { anyOf: [{ type: 'string' }, { type: 'null' }] } } } const schemaB = { $id: 'urn:schema:b', type: 'object', properties: { results: { type: 'object', properties: { items: { type: 'object', properties: { bar: { type: 'array', items: { $ref: 'urn:schema:a#/definitions/foo' } } } } } } } } const stringify = build(schemaB, { schema: { [schemaA.$id]: schemaA } }) const result = stringify({ results: { items: { bar: ['baz'] } } }) t.assert.equal(result, '{"results":{"items":{"bar":["baz"]}}}') }) })

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/krtw00/search-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server