kit icon indicating copy to clipboard operation
kit copied to clipboard

Automatically generate OpenAPI description from routes

Open gemue-parndt opened this issue 1 year ago • 0 comments

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

gemue-parndt avatar Aug 28 '24 09:08 gemue-parndt