salvo-data-extraction

Parse and validate HTTP request data into typed structures in Salvo Rust services.

1|Updated Mar 16, 2024
One-click install
npx skills add https://github.com/tdcare/genies --skill salvo-data-extraction-tdcare
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: salvo-data-extraction
Source: https://github.com/tdcare/genies/tree/main/.qoder/skills/salvo-data-extraction
Command: npx skills add https://github.com/tdcare/genies --skill salvo-data-extraction-tdcare

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

API development with Salvo often requires repetitive boilerplate to extract and validate data from requests. This skill provides a consistent, typed approach to pulling data from JSON bodies, forms, query params, and path parameters, reducing errors and improving security.

Core Features & Use Cases

  • Typed extraction from JSON bodies, query parameters, path parameters, and forms
  • Integrated validation via the validator crate with Extractible/JsonBody
  • Use cases include user creation, login, and resource lookups with clear error handling

Quick Start

Run a minimal route that parses a request body into a typed struct and validates it, then returns a success response.

Frequently Asked Questions about salvo-data-extraction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I parse and validate JSON request bodies in a Salvo web service?

To parse and validate JSON request bodies in a Salvo web service, use the JsonBody extractor to deserialize data into strongly typed structures. The validator crate then checks the extracted JSON fields against defined rules to ensure data integrity.

Can I extract query parameters and form data into typed structs using Salvo?

Yes, you can extract query parameters and form data into typed structs using Salvo. The Extractible trait enables multi-source data extraction, pulling HTTP request data directly into strongly typed Rust structures for consistent processing.

What is the best way to handle structured validation for Salvo API requests?

The best way to handle structured validation for Salvo API requests is combining the Extractible and JsonBody extractors with the validator crate. This approach validates incoming HTTP request data against typed struct rules, providing robust error handling for workflows like user creation.

Does the validator crate work with Salvo path parameters for API data extraction?

Yes, the validator crate works with Salvo path parameters for API data extraction. The Skill supports multi-source extraction, allowing you to validate path parameters, query parameters, and JSON bodies simultaneously within the same strongly typed structure.

Why do I need typed extraction for HTTP request data in Rust web services?

Typed extraction for HTTP request data in Rust web services is needed to eliminate repetitive boilerplate and reduce parsing errors. It provides a consistent, secure method to pull and validate data from forms and JSON bodies into typed structures.