schema-components - v3.7.0
    Preparing search index...
    PathKeysOf: HasPathsOrWebhooks<D> extends true
        ? PathsKey<D> | WebhooksKey<D>
        : string

    Extract the literal path keys from a document type, or the broad string fallback when the document is untyped at compile time.

    For OpenAPI 3.1 documents the union includes keys from webhooks alongside paths, because <ApiOperation> / <ApiRequestBody> / <ApiResponse> resolve webhook names through the same code path as paths (see lookupPathItem in openapi/resolve.ts). Without the webhook keys, a typed as const 3.1 document that declares only webhooks would reject every path prop value at compile time ("Type 'string' is not assignable to type 'never'") despite working at runtime.

    When the document declares neither a paths nor a webhooks map the union falls back to string so untyped/foreign inputs keep working — the constraint is informational, not gating.

    The string extends keyof P guard distinguishes a typed as const document (whose paths map has literal keys) from a runtime Record<string, unknown> document (whose keyof collapses to string). For the runtime case we surface string so callers pass arbitrary path values without losing the existing freedom.

    Type Parameters

    • D