Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: If you use 'examples' instead of 'example' in the header, the endpoint will not be displayed in the popup #167

Open
olishevskii opened this issue Oct 31, 2024 · 1 comment

Comments

@olishevskii
Copy link

olishevskii commented Oct 31, 2024

If you use 'examples' instead of 'example' in the header, the endpoint will not be displayed in the popup.

Code to reproduce the bug:

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

const app = new Elysia()
  .use(swagger({
    path: '/docs'
  })).get("/", () => "Hello Elysia", {
  headers: t.Object({
    'x-header': t.String({ description: 'Example of header', examples: ['123'], }),
  })
}).listen(3000);  
Screenshot 2024-10-31 at 17 29 45-1 Screenshot 2024-10-31 at 17 29 59

dependencies

{
  "dependencies": {
    "@elysiajs/swagger": "^1.1.5",
    "elysia": "latest"
  },
  "devDependencies": {
    "bun-types": "latest"
  },
}
@mohanads
Copy link

mohanads commented Nov 4, 2024

i'm having a similar issue related to examples (in params and body), but instead of a completely blank pop-up, Scalar UI will open the Test Request of a different route. this happens until I completely remove the examples from the 'invalid' route

EDIT: an example "examples" i was using was like so: examples: [0.09]. i tried replacing it with example: 0.09 and that worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants