Extract the methods declared on a specific path or webhook item,
restricted to the OpenAPI-recognised method set so non-method
extension keys (e.g. summary, description, parameters) do not
pollute the autocomplete.
Runtime documents (typed Record<string, unknown>) widen back to
string so callers retain the freedom to pass arbitrary method
strings without surfacing an HttpMethod constraint at runtime
call sites. Untyped documents (unknown) also widen to string so
consumers with no static doc info can supply extension methods —
the canonical HttpMethod set is informational, not gating, when
the document carries no structural information at all.
When the document declares paths or webhooks but not the
specific entry P, the union falls back to HttpMethod so callers
can still target an authored operation that compile-time inference
happens to miss (e.g. behind a deferred conditional type).
Extract the methods declared on a specific path or webhook item, restricted to the OpenAPI-recognised method set so non-method extension keys (e.g.
summary,description,parameters) do not pollute the autocomplete.Runtime documents (typed
Record<string, unknown>) widen back tostringso callers retain the freedom to pass arbitrary method strings without surfacing anHttpMethodconstraint at runtime call sites. Untyped documents (unknown) also widen tostringso consumers with no static doc info can supply extension methods — the canonicalHttpMethodset is informational, not gating, when the document carries no structural information at all.When the document declares
pathsorwebhooksbut not the specific entryP, the union falls back toHttpMethodso callers can still target an authored operation that compile-time inference happens to miss (e.g. behind a deferred conditional type).