@karmaniverous/get-dotenv
    Preparing search index...

    Class JSONSchemaGenerator

    Legacy class-based interface for JSON Schema generation. This class wraps the new functional implementation to provide backward compatibility.

    Use the toJSONSchema function instead for new code.

    // Legacy usage (still supported)
    const gen = new JSONSchemaGenerator({ target: "draft-07" });
    gen.process(schema);
    const result = gen.emit(schema);

    // Preferred modern usage
    const result = toJSONSchema(schema, { target: "draft-07" });
    Index

    Constructors

    • Parameters

      • Optionalparams: JSONSchemaGeneratorConstructorParams

      Returns JSONSchemaGenerator

    Accessors

    • get counter(): number

      Returns number

      Access via ctx instead

    • set counter(value: number): void

      Parameters

      • value: number

      Returns void

    • get io(): "input" | "output"

      Returns "input" | "output"

      Access via ctx instead

    • get metadataRegistry(): $ZodRegistry<Record<string, any>>

      Returns $ZodRegistry<Record<string, any>>

      Access via ctx instead

    • get override(): (
          ctx: {
              jsonSchema: z.core.JSONSchema.JSONSchema;
              path: (string | number)[];
              zodSchema: z.core.$ZodType;
          },
      ) => void

      Returns (
          ctx: {
              jsonSchema: z.core.JSONSchema.JSONSchema;
              path: (string | number)[];
              zodSchema: z.core.$ZodType;
          },
      ) => void

      Access via ctx instead

    • get target(): | "draft-04"
      | "draft-07"
      | "draft-2020-12"
      | "openapi-3.0"
      | {} & string

      Returns "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | {} & string

      Access via ctx instead

    • get unrepresentable(): "any" | "throw"

      Returns "any" | "throw"

      Access via ctx instead

    Methods