lambda-api
lambda-api copied to clipboard
Swagger Decorators for API Documentation
I would be great if we could add decorators to methods and params in order to export API documentation.
I've founded this package: https://github.com/TypedProject/ts-express-decorators/tree/master/packages/swagger which is for TS.ed (express TS extensions).
Maybie we can replicate something like this.
I will try to build something similar for lambda-api. I never used custom decorators before, so if someone wants to help me or constribute to this it will be welcomed :D
have you made any progress on this?
have you made any progress on this?
Steve, i could not find any extra time to do this yet. BUT What I am doing now is declaring the API with updated SAM resources, now you can declare request models in a short way and add auth to APIs without having to declare swagger.
Auth Request Model ServerlessAPI (Where u declare models, and then you relate API events with this api declaration)
So I declare api events in SAM template with Request Models, and after deploy I export swagger documentation from API Gateway console.
Its not the best solution but is something. The only caveat is that you cant define response models, but i think they will soon add it.
If you have any doubts just ask!
cool, might check that out
I'm gonna look into going the decorator route, already have a basic poc implementation, both for swagger export and also to simplify route declaration
cool, might check that out
I'm gonna look into going the decorator route, already have a basic poc implementation, both for swagger export and also to simplify route declaration
If you wanna share it maybie i can help you!