-
Notifications
You must be signed in to change notification settings - Fork 38
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
"Failed to load API definition." #6
Comments
Got it, Elysia experimental has an internal breaking change for handling schema which I haven't updated the swagger plugin to match the latest version yet. Updating to |
I assume I came a little bit too late but if you still need to solve this, @Northernside: For the "info" object, you need to nest it under "documentation". const app = new Elysia().use(
swagger({
documentation: {
info: {
title: "Elysia Documentation",
version: "1.0.0",
description: "Development docs.",
},
.. For the schema, something like this: app.get("/api", () => {
res.send("Hello World!");
},{
response: {
200: {
id: t.Number({
description: "Unique identifier.",
default: 666,
}),
name: t.String({
description: "Name of mercenary.",
default: "John Wick",
}),
},
},
detail: {
summary: `Gets details of all available mercenaries.`,
tags: ["Mercenaries"],
},
}); |
Ohh sorry for the late response. |
When trying to access the swagger url, it greets me with the following error:
And then when going to the direct JSON endpoint it shows me this in the browser:
Though, this only happens when being on the
experimental
version fromelysia
. I need that version though, because of the other routing bug inlatest
👀I don't know if I should report it here or in the other repository.
Example Code:
Also, I don't know why, but the specified
title
andversion
aren't showing either within Swagger onelysia@latest
since a few weeks.The text was updated successfully, but these errors were encountered: