axum-impl-validation

Official

Validate JSON bodies with guaranteed 422s.

AuthorImpertio-Studio
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Axum handlers can accept semantically invalid JSON because Json<T> only guarantees syntactic JSON and successful deserialization, not that the values satisfy your domain rules.

Core Features & Use Cases

  • Type-level request validation: Use a custom ValidatedJson<T> extractor so invalid payloads are rejected before the handler runs.
  • Correct status codes and error shapes: Preserve JsonRejection for malformed JSON (400-class) while mapping validator failures to 422 Unprocessable Entity.
  • Validator-driven rules: Apply validator crate checks via #[derive(Validate)] and #[validate(...)] attributes, including email, length, ranges, must-match, nested structs, and static-regex validation.

Quick Start

Use axum-impl-validation to implement ValidatedJson<T> for your request structs, ensuring validation failures return 422 with structured ValidationErrors.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: axum-impl-validation
Download link: https://github.com/Impertio-Studio/Axum-Claude-Skill-Package/archive/main.zip#axum-impl-validation

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.