agentic-openapi-parser
    Preparing search index...

    Function sanitizeJsonSchema

    • Strips/rewrites JSON Schema keywords that strict-mode function-calling parsers (e.g. OpenAI) reject or mishandle: type: 'file' isn't valid JSON Schema, default/example/pattern/ min*/max* keywords commonly trip strict validators, and explicit null values are rejected outright. Recurses into properties, items, and oneOf/anyOf/allOf branches, with a cycle guard for specs where SwaggerParser.dereference() has produced a genuinely self-referential schema object (a real object cycle, not just a repeated $ref string).

      Parameters

      • schema: unknown
      • seen: WeakSet<object> = ...

      Returns unknown