I forgot previously to mention, as a major feature compared to Kemal and others, there is a route conflict detection. An error will be raised at startup if there on any conflict.
I just added Swagger API documentation page support, all we need is:
If you want swagger as a unique selling point, creating yet another DSL on top of swagger format feels useless if I say my opinion. This is what I would like to have when I hear “openapi support”: let me create my type definitions with Array, Hashes and basic types and set them the type for the body and the response. Then have your framework generate the swagger spec for me based on those. I don’t want to write type definitions in two places.
There is only one place, the code. From it, the swagger docs are generated.
Request and response body are objects defined in the code.
Not sure to understand?
For now request_body is implemented, but not possible responses on the OpenAPI docs.
It is error-prone to have to set the possible responses in an array, the route can return totally different things than thought.
As I see, they will be generated from the route return types.
For instance, a given route get /user returns User | UserNotFound (its Proc return types). Both this types will have annotations for the error code, description, examples.
This is what I meant. The schema of a post body as well as the one of the response should be derived by the route input and return types respectively. If you want to document errors, use Unions. And possibly allow for manually having return types that span accross all routes manually, for example errors.
Ok, so nothing wrong with the actual implementation, but things missing.
Errors are a bit special – I think it will have to be like any return type, like User | InvalidUserError.
Otherwise there is no way to tell possible errors.
For parameters errors, same concept: returning an exception, or there will be a default one.
Hello everyone, I’m glad to announce you the merge of the project with Grip.
The process is still ongoing, then new repository lives here: https://github.com/grip-framework/gripen.
The main goal is to combine our efforts to make a better web framework, having both Swagger docs from Ricr and user-friendliness from Grip.