Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

455 B
Raw Blame
import { parseLiteralValues } from './parse-literal-values';
import { parseSchema } from './parse-schema';
import type { JsonSchemaObject, Refs, Serializable } from '../types';

export const parseConst = (jsonSchema: JsonSchemaObject & { const: Serializable }, refs: Refs) => {
  const { const: value, ...baseSchema } = jsonSchema;
  return parseSchema(baseSchema, { ...refs, seen: new Map(refs.seen) }, true).and(
    parseLiteralValues([value])
  );
};