gotham_restful
This crate is an extension to the popular gotham web framework for Rust. The idea is to
have several RESTful resources that can be added to the gotham router. This crate will take care
of everything else, like parsing path/query parameters, request bodies, and writing response
bodies, relying on serde and serde_json for (de)serializing. If you
enable the openapi feature, you can also generate an OpenAPI Specification from your RESTful
resources.
Usage
To use this crate, add the following to your Cargo.toml:
[]
= "0.0.1"
A basic server with only one resource, handling a simple GET request, could look like this:
/// Our RESTful Resource.
;
/// Our return type.
/// Our handler method.
/// Our main method.
Uploads and Downloads can also be handled, but you need to specify the mime type manually:
;
;
Look at the example for more methods and usage with the openapi feature.
Known Issues
These are currently known major issues. For a complete list please see the issue tracker. If you encounter any issues that aren't yet reported, please report them here.
- Enabling the
openapifeature might break code (#4) - For
chrono'sDateTimetypes, the format isdate-timeinstead ofdatetime(openapiv3#14)
License
Licensed under your option of: