DEV Community

Web Development with Rust — 03/x: Create a REST API

Bastian Gruber on April 15, 2019

Follow me on twitter to always get the latest information about web development in Rust. Also checkout the GitHub repository to this series. ...
Collapse
 
dbanty profile image
Dylan Anthony

Is there a way with any of the frameworks yet to generate a spec from your code? Thinking along the lines of Flask-RESTPlus which creates a swagger.json for you.

Collapse
 
gruberb profile image
Bastian Gruber

Not yet, but good idea! Will put it on my list :)

Collapse
 
wing328 profile image
William Cheng • Edited

Very informative article.

You may also want to try the rust-server generator in OpenAPI Generator (free, open-source) to generate the server stubs in Rust as a starting point.

Ref: github.com/OpenAPITools/openapi-ge...

Collapse
 
sparkout profile image
AI Development Company

Great breakdown of building APIs with Rust! The explanation of HTTP requests, CORS handling, and the role of frameworks like Actix, Rocket, and Tide is really helpful. The importance of serde for input validation is a key takeaway to avoid panics and ensure smooth data handling. Rust’s strong compiler makes it ideal for building reliable, production-ready services.

Want to get started with your own Rust API? Explore the frameworks mentioned here and start building your app today!

Collapse
 
sswapnil2 profile image
swapnil shindemeshram

Have you compared speed of execution with other frameworks.

Collapse
 
gruberb profile image
Bastian Gruber

Yes you can, although for production use I wouldn't recommend it!