feat: enhanced request object typing #122
Annotations
3 errors
test/request-body.test-d.ts > Given an OpenAPI schema endpoint with request content > When a request is expected to contain content, Then the content is strict-typed:
test/request-body.test-d.ts#L14
TypeCheckError: Type 'StrictRequest<{ name string; value number; }>' does not satisfy the constraint '{ headers { get (name string) => string | null; delete (name string) => void; forEach (callbackfn (value string, key string, parent Headers) => void, thisArg? any) => void; has (name string) => boolean; set (name string, value string) => void; append (name string, value string) => void; getSetCook...'.
Types of property 'text' are incompatible.
Type '() => Promise<string>' is not assignable to type '"Expected function, Actual never"'.
❯ test/request-body.test-d.ts:14:27
|
test/request-body.test-d.ts > Given an OpenAPI schema endpoint with request content > When a request is not expected to contain content, Then the content is undefined:
test/request-body.test-d.ts#L32
TypeCheckError: Type 'StrictRequest<undefined>' does not satisfy the constraint '{ headers { get (name string) => string | null; delete (name string) => void; forEach (callbackfn (value string, key string, parent Headers) => void, thisArg? any) => void; has (name string) => boolean; set (name string, value string) => void; append (name string, value string) => void; getSetCook...'.
Types of property 'json' are incompatible.
Type '() => Promise<undefined>' is not assignable to type '"Expected function, Actual never"'.
❯ test/request-body.test-d.ts:32:27
|
build
Process completed with exit code 1.
|