Skip to content

Automatically generate OpenAPI description from routes #12623

@gemue-parndt

Description

@gemue-parndt

Describe the problem

On bigger projects having multiple API endpoints it's an advantage to have an OpenAPI description and using SwaggerUI.
Unfortunately SvelteKit doesn't proivde this out of the box. There are some libraries doing so but all of them are outdated and not having all functionalities needed.

For example i've found one, but the library doesn't provide Authorization in den OpenAPI schema and therefor also not in de SwaggerUI.

Describe the proposed solution

Generate OpenAPI description from the +server.ts files. Allow to add decorators or use defined comments to specify more details on the desired route.

For example someone can write a comment on the function with:

/**
* Description
* 
* @auth basic / bearer 
* @more :)
*/

Alternatives considered

I have looked at some libraries generating the code from the +server.ts but as described above one cannot provide additonal informations.

Importance

i cannot use SvelteKit without it

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions