Skip to content

[BUG] Getting Error while specified schema.request.headers fields. #282

Description

@zzx58-027

A minimal cloudflare API starter could reproduce the error by: bun create cloudflare@latest.

Just define the headers in request, then you could see it.

Please let me know if you need extra helps.

Image Image

✘ [ERROR] TypeError: schema2.openapi is not a function
at null.
(file:///Users/zzx58/Desktop/DevProjects/Wishing-PIM/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:1000:54)
at Array.map ()
at OpenAPIGenerator.generateInlineParameters
(file:///Users/zzx58/Desktop/DevProjects/Wishing-PIM/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:975:58)
at enhanceMissingParametersError.location
(file:///Users/zzx58/Desktop/DevProjects/Wishing-PIM/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:1145:24)
at enhanceMissingParametersError
(file:///Users/zzx58/Desktop/DevProjects/Wishing-PIM/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:353:16)
at OpenAPIGenerator.getParameters
(file:///Users/zzx58/Desktop/DevProjects/Wishing-PIM/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:1139:34)
at enhanceMissingParametersError.route
(file:///Users/zzx58/Desktop/DevProjects/Wishing-PIM/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:1168:69)
at enhanceMissingParametersError
(file:///Users/zzx58/Desktop/DevProjects/Wishing-PIM/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:353:16)
at OpenAPIGenerator.generatePath
(file:///Users/zzx58/Desktop/DevProjects/Wishing-PIM/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:1168:28)
at OpenAPIGenerator.generateSingleRoute
(file:///Users/zzx58/Desktop/DevProjects/Wishing-PIM/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:1180:31)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions