Replies: 1 comment 3 replies
-
Welcome @dmpvost! These are all awesome ideas! Right now, all of Actionhero's swagger tooling lives in user-space, within the Keeping the above in mind, I think the quickest way to build the For your other suggestions, I'd be a little wary of adding Swagger decoration/tooling as a primitive to all Actionhero Actions. We try to keep actions generic for all of the transports Actionhero can provide, and Swagger really only works for HTTP, not websocket, TCP socket, etc. BUT, you could certainly add that as part of a plugin! Rather than extending Also, I personally don't use Swagger and rely more on Typescript to keep my font and back-ends in sync (https://www.grouparoo.com/blog/typescript-frontend-backend)... so I'm probably not the best person to ask what a modern Swagger project looks like 😄 |
Beta Was this translation helpful? Give feedback.
-
First, congratulation for ActionHero! I think it's really great!
It's what I was trying to do with 2 projects myself, and the modularity is the most difficult part. I love the plugin idea!
Swagger improvement
I saw that ActionHero generate a Swagger documentation, that is great! 👍
It could be nice if it's go deeper
Currently, there is no
swagger.yaml
generate, could de in/dist
?Why? swagger.yaml could be use with all swagger generator available, so it's easier to start a front app when all API is generate. (it's how we work on my company)
In the documentation, right now, there are no definition, so impossible to generate object from documentation.
It could be nice to have a fully documentation ready for generator.
ActionToSwagger
It could be nice if we could add some swagger decoration about input / output
Something like this maybe?
It's just the idea, but if we are able description input/output with object, it open a lot of possibility to be compatible with a lot of things.
Goal: have a full documentation OpenApi 2.0 (for start)
SwaggerToAction
I saw that the CLI could create a new action!
We could parse swagger.yaml of any existing project, that will help for migration to ActionHero, and generate all action and route by the way from documentation
Of course it's only a squelette, but it help to start with something.
And finally, after running ActionToSwagger, we could find back our documentation in
dist/swagger.yaml
Why?
By exemple, I have few project using swagger as a core feature.
So I have multiple projet documented, with 14k lignes of swagger ready to be used.
As swagger documentation become more and more popular it could be a great feature
How to do that?
how combine, input, object definition, swagger definition, with decorator? with something else?
There is
typescript-rest
andtypescript-rest-swagger
as beginningAnd after just generate the documentation
Parsing the documentation is not so difficult, and use the existing CLI with more option as parameters?
For object,
swagger-codegen
generate them well with angular option. I use the model generate currently on all my project.But maybe it's better to generator our ActionModel from documentation, so it could generate object inside the projet with
Input
in the same way?I mean
Input
of an ActionLast question: what is the right place for this feature? As a plugin? As a core feature? As an NPM module?
Beta Was this translation helpful? Give feedback.
All reactions