saskodh / framework

Lightweight web framework for NodeJS inspired by Spring framework
26 stars 5 forks source link

Swagger integration POC #25

Open saskodh opened 8 years ago

saskodh commented 8 years ago

Background

Swagger is a tool which is widely used for generating web UI for RESTful APIs. It become so popular that recently it's specification was taken as a foundation of the OpenAPI specification. Swagger UI works with the Swagger specification which extensively documents each endpoint of the API and provides interactive way of testing the existing API. Swagger specification can be written manually for any RESTful API and there are already tools for doing that automatically for many languages and frameworks. There are even code generators that generate stub implementations from written Swagger specification.

Goal

Implement a tool that will automatically generate Swagger specification out of the @Controller components.

Implementation hint

Use the TypeScript compiler API to collect the metadata from the controllers and use it to generate valid Swagger spec (inspired by tsoa).