nette-schema

Validate and normalize PHP data structures with Nette Schema.

41|4|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/nette/claude-code --skill nette-schema
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nette-schema
Source: https://github.com/nette/claude-code/tree/main/plugins/nette/skills/nette-schema
Command: npx skills add https://github.com/nette/claude-code --skill nette-schema

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a PHP-based approach to validate and normalize data structures using Nette Schema (Expect). It helps developers ensure configurations are correct, API inputs are sanitized, and runtime data conforms to defined shapes, reducing runtime errors and inconsistencies.

Core Features & Use Cases

  • Validate and normalize data structures against a defined schema.
  • Support nested structures, arrays, patterns, and type rules.
  • Ideal for configuration validation, API input validation, and data processing pipelines in PHP projects leveraging the Nette Schema library.
  • Clear, actionable error reporting to guide fixes.

Quick Start

Install the Nette Schema package:

  • composer require nette/schema

Create a simple schema and validate data:

  • Define a schema with Expect::structure([...]) and use the Processor to validate a data array
  • Catch ValidationException to handle invalid input.

Frequently Asked Questions about nette-schema

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

FAQPage Schema
How do I validate and normalize API input data in PHP?

You can validate and normalize API input data in PHP by defining expected shapes and type rules using Nette Schema's Expect class, then processing the input through the Processor to ensure data conforms to your defined structure.

What is the best way to validate nested configuration arrays in PHP applications?

Validating nested configuration arrays in PHP is best handled by defining a schema with Expect::structure(), which allows you to specify nested structures, array patterns, and type rules for robust data normalization.

How does data normalization work with Nette Schema in PHP?

Data normalization with Nette Schema works by applying the Processor class to your raw data array, which checks the input against your defined schema rules and transforms it into a consistent, normalized structure.

Can I catch validation errors when processing data structures in PHP?

Yes, you can catch validation errors in PHP by catching the ValidationException thrown by the Processor, which provides clear, actionable error reporting to guide fixes for invalid input data.

Do I need Composer to use Nette Schema for data validation?

Yes, you need Composer to install the nette/schema package via the 'composer require nette/schema' command, which provides the Processor class and Expect definitions needed to validate data structures in PHP.

What are the limitations of using Nette Schema for data validation?

Nette Schema is specifically designed for validating and normalizing data structures in PHP applications, meaning it is limited to PHP environments and requires the nette/schema package to execute schema processing and error reporting.