@accelerated-software-development/caddy-api-client - v0.10.0
    Preparing search index...

    Variable CaddyRouteMatcherSchemaConst

    CaddyRouteMatcherSchema: ZodObject<
        {
            client_ip: ZodOptional<
                ZodObject<
                    { ranges: ZodOptional<ZodArray<ZodString, "many">> },
                    "strip",
                    ZodTypeAny,
                    { ranges?: string[] },
                    { ranges?: string[] },
                >,
            >;
            expression: ZodOptional<ZodString>;
            file: ZodOptional<
                ZodObject<
                    {
                        fs: ZodOptional<ZodString>;
                        root: ZodOptional<ZodString>;
                        split_path: ZodOptional<ZodArray<ZodString, "many">>;
                        try_files: ZodOptional<ZodArray<ZodString, "many">>;
                        try_policy: ZodOptional<ZodString>;
                    },
                    "strip",
                    ZodTypeAny,
                    {
                        fs?: string;
                        root?: string;
                        split_path?: string[];
                        try_files?: string[];
                        try_policy?: string;
                    },
                    {
                        fs?: string;
                        root?: string;
                        split_path?: string[];
                        try_files?: string[];
                        try_policy?: string;
                    },
                >,
            >;
            header: ZodOptional<ZodRecord<ZodString, ZodArray<ZodString, "many">>>;
            header_regexp: ZodOptional<
                ZodRecord<
                    ZodString,
                    ZodUnion<
                        [
                            ZodObject<
                                { name: ZodOptional<ZodString>; pattern: ZodString },
                                "strip",
                                ZodTypeAny,
                                { name?: string; pattern: string },
                                { name?: string; pattern: string },
                            >,
                            ZodUndefined,
                        ],
                    >,
                >,
            >;
            host: ZodOptional<ZodArray<ZodString, "many">>;
            method: ZodOptional<ZodArray<ZodString, "many">>;
            not: ZodOptional<ZodArray<ZodRecord<ZodString, ZodUnknown>, "many">>;
            path: ZodOptional<ZodArray<ZodString, "many">>;
            path_regexp: ZodOptional<
                ZodObject<
                    { name: ZodOptional<ZodString>; pattern: ZodString },
                    "strip",
                    ZodTypeAny,
                    { name?: string; pattern: string },
                    { name?: string; pattern: string },
                >,
            >;
            protocol: ZodOptional<ZodString>;
            query: ZodOptional<ZodRecord<ZodString, ZodArray<ZodString, "many">>>;
            remote_ip: ZodOptional<
                ZodObject<
                    { ranges: ZodOptional<ZodArray<ZodString, "many">> },
                    "strip",
                    ZodTypeAny,
                    { ranges?: string[] },
                    { ranges?: string[] },
                >,
            >;
            tls: ZodOptional<
                ZodObject<
                    { handshake_complete: ZodOptional<ZodBoolean> },
                    "strip",
                    ZodTypeAny,
                    { handshake_complete?: boolean },
                    { handshake_complete?: boolean },
                >,
            >;
        },
        "strip",
        ZodTypeAny,
        {
            client_ip?: { ranges?: string[] };
            expression?: string;
            file?: {
                fs?: string;
                root?: string;
                split_path?: string[];
                try_files?: string[];
                try_policy?: string;
            };
            header?: Record<string, string[]>;
            header_regexp?: Record<
                string,
                { name?: string; pattern: string }
                | undefined,
            >;
            host?: string[];
            method?: string[];
            not?: Record<string, unknown>[];
            path?: string[];
            path_regexp?: { name?: string; pattern: string };
            protocol?: string;
            query?: Record<string, string[]>;
            remote_ip?: { ranges?: string[] };
            tls?: { handshake_complete?: boolean };
        },
        {
            client_ip?: { ranges?: string[] };
            expression?: string;
            file?: {
                fs?: string;
                root?: string;
                split_path?: string[];
                try_files?: string[];
                try_policy?: string;
            };
            header?: Record<string, string[]>;
            header_regexp?: Record<
                string,
                { name?: string; pattern: string }
                | undefined,
            >;
            host?: string[];
            method?: string[];
            not?: Record<string, unknown>[];
            path?: string[];
            path_regexp?: { name?: string; pattern: string };
            protocol?: string;
            query?: Record<string, string[]>;
            remote_ip?: { ranges?: string[] };
            tls?: { handshake_complete?: boolean };
        },
    > = ...

    Caddy route matcher schema — covers every http.matchers.* module except vars_regexp (internal Caddy variable matching). file (http.matchers.file) is generated in caddy-fileserver.ts rather than caddy-http.ts — see matcher-schema-consistency.test.ts's NON_MATCHER_HELPER_TYPES/scope note — but is composed here from the real generated matchFileSchema, same as the other matchers below.

    protocol, remote_ip, client_ip, header_regexp, and tls are the real, correctly tygo-generated matchProtocolSchema/ matchRemoteIpSchema/matchClientIpSchema/matchHeaderReSchema/ matchTlsSchema from caddy-http.zod.ts — composed here, not duplicated by hand.

    not, expression, and path_regexp are hand-overridden (not composed from the generated matchNotSchema/matchExpressionSchema/ matchPathReSchema) because all three have custom JSON marshaling or anonymous Go struct embedding that tygo's naive extraction gets wrong — verified against real Caddy via caddy validate, not just inferred from the generated struct shape:

    • not (http.matchers.not, Go type MatchNot) is an array of matcher sets (each an object keyed by matcher name); the generated matchNotSchema is z.object({}) (empty), reflecting Go's empty interface rather than the true custom-unmarshaled shape.
    • expression (http.matchers.expression, Go type MatchExpression) is a plain CEL string; the generated matchExpressionSchema is z.object({ expr, name }), reflecting misleading Go struct fields — the doc comment explicitly says "this matcher's JSON interface is actually a string, not a struct".
    • path_regexp (http.matchers.path_regexp, Go type MatchPathRE) flattens to { name?, pattern } directly; the generated matchPathReSchema wraps it as { MatchRegexp: { name?, pattern } } — an anonymous-embedding artifact (same class of bug as caddy-dns/route53's wrapper, see DEPENDENCIES.md) — Caddy rejects the nested form with json: unknown field "MatchRegexp". If any of these three Go types' custom marshaling/embedding ever changes, tygo/zod-to-json-schema won't catch it — re-verify with caddy validate before trusting a regen here.