Skip to content

OpenAPI spec generation fails (Error 500) with outputStructure: "detailed" #1302

@theoludwig

Description

@theoludwig

Environment

Node.js v24.12.0, orpc v1.12.3

Reproduction

https://github.com/theoludwig/orpc-repro

Describe the bug

A procedure like the following (notably with outputStructure: "detailed"):

callback: publicProcedure
.route({
  method: "GET",
  path: "/whatever",
  successStatus: 302,
  outputStructure: "detailed",
})
.handler(async () => {
  return {
    headers: {
      location: "/some-url",
    },
  }
})

Will make it so that going to OpenAPI documentation, will returns a HTTP Error 500:

{"defined":false,"code":"INTERNAL_SERVER_ERROR","status":500,"message":"Internal server error"}

As soon as I put in comments the procedure, the documentation work again.
I tried also, by returning something else that headers.location, like a body, but same issue.

Additional context

No response

Logs

No logs in the Node.js terminal, so no clue what is going on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions