Feature Comparison
How Pedantigo compares to Pydantic v2 and go-playground/validator v10.
Legend: ✓ Supported | ✗ Not supported | ~ Partial
Validation Basics
| Feature | Pedantigo | Pydantic | Validator | Docs |
|---|---|---|---|---|
| Required fields | ✓ | ✓ | ✓ | Validation |
| Optional fields | ✓ | ✓ | ✓ | Validation |
| Default values (static) | ✓ | ✓ | ✗ | Constraints |
| Default values (dynamic) | ✓ | ✓ | ✗ | Validation |
| Field presence detection | ✓ | ✓ | ✓ | Initialization |
| Zero vs missing distinction | ✓ | ✓ | ~ | Initialization |
String Constraints
| Feature | Pedantigo | Pydantic | Validator | Docs |
|---|---|---|---|---|
| Min/Max length | ✓ | ✓ | ✓ | String |
| Exact length | ✓ | ~ | ✓ | String |
| ✓ | ✓ | ✓ | Format | |
| URL | ✓ | ✓ | ✓ | Format |
| URI | ✓ | ✗ | ✓ | Format |
| UUID | ✓ | ✓ | ✓ | Format |
| UUID3/UUID4/UUID5 | ✓ | ✗ | ✓ | Format |
| Regex/Pattern | ✓ | ✓ | ✓ | String |
| Enum/OneOf | ✓ | ✓ | ✓ | Constraints |
| Enum case-insensitive | ✓ | ✗ | ✓ | Constraints |
| Alpha/Alphanumeric | ✓ | ✗ | ✓ | String |
| ASCII only | ✓ | ✗ | ✓ | String |
| Multibyte chars | ✓ | ✗ | ✓ | String |
| Contains/Excludes | ✓ | ✗ | ✓ | String |
| Starts/Ends with | ✓ | ✗ | ✓ | String |
| Case validation | ✓ | ✗ | ✓ | String |
| Strip whitespace | ✓ | ✓ | ✗ | String |
| String transform | ✓ | ✓ | ✗ | String |
Numeric Constraints
| Feature | Pedantigo | Pydantic | Validator | Docs |
|---|---|---|---|---|
| Min/Max value | ✓ | ✓ | ✓ | Numeric |
| Greater/Less than | ✓ | ✓ | ✓ | Numeric |
| Greater/Less or equal | ✓ | ✓ | ✓ | Numeric |
| Multiple of | ✓ | ✓ | ✗ | Numeric |
| Decimal precision | ✓ | ✓ | ✗ | Numeric |
| Disallow inf/nan | ✓ | ✓ | ✗ | Numeric |
| Strict types | ✗ | ✓ | ✗ | — |
| Positive/Negative | ✓ | ✓ | ✗ | Numeric |
Format Validators
| Feature | Pedantigo | Pydantic | Validator | Standard | Docs |
|---|---|---|---|---|---|
| IPv4/IPv6 | ✓ | ✓ | ✓ | net.ParseIP | Format |
| IP (any) | ✓ | ✓ | ✓ | net.ParseIP | Format |
| CIDR | ✓ | ✓ | ✓ | RFC 4632 | Format |
| CIDRv4/CIDRv6 | ✓ | ✓ | ✓ | RFC 4632 | Format |
| MAC address | ✓ | ✗ | ✓ | IEEE 802 | Format |
| Hostname | ✓ | ✗ | ✓ | RFC 952 | Format |
| Hostname RFC1123 | ✓ | ✗ | ✓ | RFC 1123 | Format |
| FQDN | ✓ | ✗ | ✓ | DNS standard | Format |
| Port | ✓ | ✗ | ✓ | 0-65535 | Format |
| TCP/UDP address | ✓ | ✗ | ✓ | net.ResolveTCPAddr | Format |
| HTTP URL | ✓ | ✗ | ✓ | RFC 3986 | Format |
| HTTPS URL | ✓ | ✗ | ✓ | RFC 3986 | Format |
| Credit card | ✓ | ✓ | ✓ | ISO/IEC 7812 | Format |
| Bitcoin address | ✓ | ✗ | ✓ | Base58Check | Format |
| Bitcoin Bech32 | ✓ | ✗ | ✓ | BIP-0173 | Format |
| Ethereum address | ✓ | ✗ | ✓ | EIP-55 | Format |
| ISBN | ✓ | ✗ | ✓ | ISO 2108 | Format |
| ISBN-10/ISBN-13 | ✓ | ✗ | ✓ | ISO 2108 | Format |
| ISSN | ✓ | ✗ | ✓ | ISO 3297 | Format |
| SSN | ✓ | ✗ | ✓ | U.S. SSA | Format |
| EIN | ✓ | ✗ | ✓ | U.S. IRS | Format |
| Phone (E.164) | ✓ | ~ | ✓ | ITU-T E.164 | Format |
| Latitude | ✓ | ✗ | ✓ | WGS 84 | Format |
| Longitude | ✓ | ✗ | ✓ | WGS 84 | Format |
| Hex color | ✓ | ~ | ✓ | CSS Color | Format |
| RGB/RGBA | ✓ | ~ | ✓ | CSS Color | Format |
| HSL/HSLA | ✓ | ~ | ✓ | CSS Color | Format |
| iscolor (alias) | ✓ | ✗ | ✓ | Any color | Format |
| HTML | ✓ | ✗ | ✓ | HTML5 | Format |
| JWT | ✓ | ~ | ✓ | RFC 7519 | Format |
| JSON string | ✓ | ✓ | ✓ | RFC 8259 | Format |
| Base64 | ✓ | ✓ | ✓ | RFC 4648 | Format |
| Base64URL | ✓ | ✓ | ✓ | RFC 4648 §5 | Format |
| Base64RawURL | ✓ | ✗ | ✓ | RFC 4648 §3.2 | Format |
| Base32 | ✓ | ✗ | ✓ | RFC 4648 §6 | Format |
| Data URI | ✓ | ✗ | ✓ | RFC 2397 | Format |
| URN (RFC 2141) | ✓ | ✗ | ✓ | RFC 2141 | Format |
| MD4 | ✓ | ✗ | ✓ | RFC 1320 | Format |
| MD5 | ✓ | ✗ | ✓ | RFC 1321 | Format |
| SHA256/384/512 | ✓ | ✗ | ✓ | FIPS 180-4 | Format |
| MongoDB ID | ✓ | ✗ | ✓ | ObjectId | Format |
| Cron | ✓ | ✗ | ✓ | Cron expr | Format |
| Semver | ✓ | ~ | ✓ | Semver 2.0 | Format |
| Datetime format | ✓ | ✓ | ✓ | Go layout | Format |
| Timezone (IANA) | ✓ | ✗ | ✓ | IANA tz database | Format |
| ULID | ✓ | ✗ | ✓ | Crockford | Format |
| Luhn checksum | ✓ | ✗ | ✓ | ISO 7812 | Format |
| Country codes | ✓ | ~ | ✓ | ISO 3166-1 | Format |
| Currency codes | ✓ | ~ | ✓ | ISO 4217 | Format |
| Language codes | ✓ | ~ | ✓ | BCP 47 | Format |
| Postal codes | ✓ | ✗ | ✓ | Per-country | Format |
Collection Validation
| Feature | Pedantigo | Pydantic | Validator | Docs |
|---|---|---|---|---|
| Array/Slice min/max | ✓ | ✓ | ✓ | Collection |
| Element validation (dive) | ✓ | ✓ | ✓ | Collection |
| Map validation | ✓ | ✓ | ✓ | Collection |
| Map key validation (keys) | ✓ | ✓ | ✓ | Collection |
| Unique items | ✓ | ✓ | ✓ | Collection |
| Set types | ✗ | ✓ | ✗ | — |
| Tuple types | ✗ | ✓ | ✗ | — |
Cross-Field Validation
| Feature | Pedantigo | Pydantic | Validator | Docs |
|---|---|---|---|---|
| Struct-level validators | ✓ | ✓ | ✓ | Cross-Field |
| Field comparisons | ✓ | ✓ | ✓ | Cross-Field |
| Cross-struct validation | ✓ | ✓ | ✓ | Cross-Field |
| Conditional required | ✓ | ✓ | ✓ | Cross-Field |
| Conditional required (all) | ✓ | ✗ | ✓ | Cross-Field |
| Conditional exclusion | ✓ | ✓ | ✓ | Cross-Field |
| Conditional exclusion (all) | ✓ | ✗ | ✓ | Cross-Field |
| Before validators | ✗ | ✓ | ✗ | — |
| After validators | ✓ | ✓ | ✗ | Custom Validators |
| Wrap validators | ✗ | ✓ | ✗ | — |
Type Support
| Feature | Pedantigo | Pydantic | Validator | Docs |
|---|---|---|---|---|
| Primitives | ✓ | ✓ | ✓ | Validation |
| Pointers/Optional | ✓ | ✓ | ✓ | Validation |
| Nested structs | ✓ | ✓ | ✓ | Validation |
| Slices/Lists | ✓ | ✓ | ✓ | Collection |
| Maps/Dicts | ✓ | ✓ | ✓ | Collection |
| time.Time/datetime | ✓ | ✓ | ~ | Validation |
| time.Duration | ✓ | ✓ | ✗ | Validation |
| Secret types | ✓ | ✓ | ✗ | Secrets |
| Path types | ✓ | ✓ | ~ | Format |
| Literal types | ✗ | ✓ | ✗ | — |
| Union types | ✓ | ✓ | ✗ | Unions |
| Discriminated unions | ✓ | ✓ | ✗ | Unions |
| Generic structs | ✗ | ✓ | ✗ | — |
| Enum types | ~ | ✓ | ~ | Constraints |
| Decimal | ✗ | ✓ | ✗ | — |
JSON Operations
| Feature | Pedantigo | Pydantic | Validator | Docs |
|---|---|---|---|---|
| Unmarshal + validate | ✓ | ✓ | ✗ | Simple API |
| Marshal to JSON | ✓ | ✓ | ✗ | Simple API |
| Marshal with field exclusion | ✓ | ✓ | ✗ | Simple API |
| Marshal with field selection | ✓ | ✓ | ✗ | Simple API |
| Marshal omitting zero values | ✓ | ✓ | ~ | Simple API |
| Marshal using JSON tags | ~ | ✓ | ✓ | Simple API |
| Custom MarshalJSON methods | ✗ | ✓ | ✓ | — |
| Streaming JSON | ✓ | ✗ | ✗ | Streaming |
| Partial JSON repair | ✗ | ✗ | ✗ | — |
Schema Generation
| Feature | Pedantigo | Pydantic | Validator | Docs |
|---|---|---|---|---|
| JSON Schema | ✓ | ✓ | ✗ | Schema |
| OpenAPI ($ref) | ✓ | ✓ | ✗ | Schema |
| Schema caching | ✓ | ✓ | ✗ | Schema |
| Schema examples | ✓ | ✓ | ✗ | Schema |
| Schema title | ✓ | ✓ | ✗ | Schema |
| Field descriptions | ✓ | ✓ | ✗ | Schema |
| Deprecated fields | ✓ | ✓ | ✗ | Schema |
Struct Configuration
| Feature | Pedantigo | Pydantic | Validator | Docs |
|---|---|---|---|---|
| Strict mode | ~ | ✓ | ✗ | Initialization |
| Extra fields forbid | ✓ | ✓ | ✗ | Initialization |
| Extra fields allow | ✓ | ✓ | ✗ | Initialization |
| Extra fields ignore | ✓ | ✓ | ✗ | Initialization |
| Validate on assignment | ✗ | ✓ | ✗ | — |
| Validate defaults | ✓ | ✓ | ✗ | Initialization |
| ORM mode | ✗ | ✓ | ✗ | — |
| Arbitrary types | ✗ | ✓ | ✗ | — |
| Immutable structs | ✗ | ✓ | ✗ | — |
Error Handling
| Feature | Pedantigo | Pydantic | Validator | Docs |
|---|---|---|---|---|
| Multiple errors | ✓ | ✓ | ✓ | Errors |
| Field paths | ✓ | ✓ | ✓ | Errors |
| Custom messages | ~ | ✓ | ✓ | Errors |
| Error codes | ✓ | ✓ | ✗ | Errors |
| i18n/l10n | ✗ | ~ | ✓ | — |
| Custom error types | ✗ | ✓ | ✗ | — |
Custom Validation
| Feature | Pedantigo | Pydantic | Validator | Docs |
|---|---|---|---|---|
| Custom validators | ✓ | ✓ | ✓ | Custom Validators |
| Validator registration | ✓ | ✓ | ✓ | Custom Validators |
| Alias tags | ✓ | ~ | ✓ | Custom Validators |
| Validator context | ✓ | ✓ | ✓ | Custom Validators |
| Struct-level | ✓ | ✓ | ✓ | Custom Validators |
| Plugin system | ✗ | ✓ | ✗ | — |
Advanced Features
| Feature | Pedantigo | Pydantic | Validator | Docs |
|---|---|---|---|---|
| Type adapters | ✗ | ✓ | ✗ | — |
| Root models | ✗ | ✓ | ✗ | — |
| Dataclass support | ✗ | ✓ | ✗ | — |
| Config management | ✗ | ✓ | ✗ | — |
| Environment variables | ✗ | ✓ | ✗ | — |
| Struct copying | ✗ | ✓ | ✗ | — |
| Struct field reflection | ✗ | ✓ | ✗ | — |
| Recursive structs | ✓ | ✓ | ✓ | Validation |
Summary
144/147 features — Full parity with go-playground/validator. Near-complete parity with Pydantic v2.
| Category | Coverage |
|---|---|
| Validation Basics | 6/6 |
| String Constraints | 16/16 |
| Numeric Constraints | 7/8 |
| Format Validators | 46/46 |
| Collection Validation | 5/7 |
| Cross-Field Validation | 7/10 |
| Type Support | 12/15 |
| JSON Operations | 7/9 |
| Schema Generation | 7/7 |
| Struct Configuration | 5/9 |
| Error Handling | 4/6 |
| Custom Validation | 5/6 |
| Advanced Features | 1/8 |