dependabot[bot] 860eb54aa2 chore(deps-dev): bump rimraf from 4.3.1 to 5.0.5
Bumps [rimraf](https://github.com/isaacs/rimraf) from 4.3.1 to 5.0.5.
- [Changelog](https://github.com/isaacs/rimraf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/rimraf/compare/v4.3.1...v5.0.5)

---
updated-dependencies:
- dependency-name: rimraf
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-27 17:09:40 +00:00
2023-09-18 17:41:27 -03:00
2023-09-26 18:21:17 +07:00
2023-09-26 18:02:38 +07:00
2022-11-12 10:09:01 +07:00
2022-12-06 22:55:56 +07:00
2022-12-22 11:12:06 +07:00
2023-09-26 18:21:17 +07:00
2023-09-26 18:21:17 +07:00
2022-11-12 10:09:01 +07:00
2022-12-04 21:18:29 +07:00
2023-09-26 18:02:38 +07:00
2023-09-26 18:02:38 +07:00

@elysiajs/swagger

Plugin for elysia to auto-generate Swagger page.

Installation

bun add @elysiajs/swagger

Example

import { Elysia } from 'elysia'
import { swagger } from '@elysiajs/swagger'

const app = new Elysia()
    .use(swagger())
    .get('/', () => 'hi')
    .get('/unpath/:id', ({ params: { id } }) => id)
    .get('/unpath/:id/:name', ({ params: { id, name } }) => `${id} ${name}`)
    .post(
        '/json/:id',
        ({ body, params: { id }, query: { name } }) => ({
            ...body,
            id,
            name
        }),
        {
            schema: {
                params: t.Object({
                    id: t.String()
                }),
                query: t.Object({
                    name: t.String()
                }),
                body: t.Object({
                    username: t.String(),
                    password: t.String()
                }),
                response: t.Object({
                    username: t.String(),
                    password: t.String(),
                    id: t.String(),
                    name: t.String()
                })
            }
        }
    )
    .listen(8080)

Then go to http://localhost:8080/swagger.

config

swagger

Customize Swagger config, refers to Swagger 2.0 config

path

@default '/swagger'

The endpoint to expose Swagger

excludeStaticFile

@default true

Determine if Swagger should exclude static files.

exclude

@default []

Paths to exclude from the Swagger endpoint

Description
A plugin for Elysia to auto-generate Swagger page
Readme MIT 966 KiB
Languages
TypeScript 98.9%
JavaScript 1.1%