Skip to main content
Glama
serializer-compiler.js893 B
'use strict' const AjvJTD = require('ajv/dist/jtd') const defaultAjvOptions = require('./default-ajv-options') class SerializerCompiler { constructor (_externalSchemas, options) { this.ajv = new AjvJTD(Object.assign({}, defaultAjvOptions, options)) /** * https://ajv.js.org/json-type-definition.html#ref-form * Unlike JSON Schema, JTD does not allow to reference: * - any schema fragment other than root level definitions member * - root of the schema - there is another way to define a self-recursive schema (see Example 2) * - another schema file (but you can still combine schemas from multiple files using JavaScript). * * So we ignore the externalSchemas parameter. */ } buildSerializerFunction ({ schema/*, method, url, httpStatus */ }) { return this.ajv.compileSerializer(schema) } } module.exports = SerializerCompiler

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