Skip to content

Custom operationId ignored #242

@niklas-stegmann

Description

@niklas-stegmann

After migrating from @elysiajs/swagger to @elysiajs/openapi (v1.3.11), custom operationId defined in detail is ignored and replaced by an auto-generated one.


Minimal reproduction

import { Elysia, t } from "elysia";
import { openapi } from "@elysiajs/openapi";

new Elysia()
  .use(openapi())
  .get("/check", () => true, {
    needsAuth: false,
    detail: {
      operationId: "checkSession",
      summary: "Check auth session"
    },
    response: t.Boolean({
      description: "True if session is valid",
      examples: [true]
    })
  })
  .listen(3000);

Exxpected OpenAPI JSON

"/check": {
  "get": {
    "operationId": "checkSession",
    "summary": "Check auth session",
    ...
  }
}

Actual Output

"/check": {
  "get": {
    "operationId": "getCheck",
    "summary": "Check auth session",
    ...
  }
}

Environment

  • @elysiajs/openapi v1.3.11
  • elysia v1.3.13
  • bun v1.2.20

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions