Cleanup swagger examples

This commit is contained in:
Zoe Roux 2024-12-19 16:19:13 +01:00
parent 43ae26679a
commit 3a7a12bfd3
No known key found for this signature in database

View File

@ -89,34 +89,44 @@ export const movies = new Elysia({ prefix: "/movies", tags: ["movies"] })
}, },
params: t.Object({ params: t.Object({
id: t.String({ id: t.String({
description: "The id or slug of the movie to retrieve", description: "The id or slug of the movie to retrieve.",
examples: [bubble.slug], example: bubble.slug,
}), }),
}), }),
headers: t.Object({ headers: t.Object({
"accept-language": t.String({ "accept-language": t.String({
default: "*", default: "*",
examples: "en-us, ja;q=0.5", example: "en-us, ja;q=0.5",
description: comment` description: comment`
List of languages you want the data in. List of languages you want the data in.
This follows the Accept-Language offical specification This follows the Accept-Language offical specification
(https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language) (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language).
`, `,
}), }),
}), }),
response: { response: {
200: "movie", 200: { ...Movie, description: "Found" },
404: { 404: {
...KError, ...KError,
description: "No movie found with the given id or slug.", description: "No movie found with the given id or slug.",
examples: [
{ status: 404, message: "Movie not found", details: undefined },
],
}, },
422: { 422: {
...KError, ...KError,
description: comment` description: comment`
The Accept-Language header can't be satisfied (all languages listed are The Accept-Language header can't be satisfied (all languages listed are
unavailable). Try with another languages or add * to the list of languages unavailable). Try with another languages or add * to the list of languages
to fallback to any language. to fallback to any language.
`, `,
examples: [
{
status: 422,
message: "Accept-Language header could not be satisfied.",
details: undefined,
},
],
}, },
}, },
}, },