awesome-repositories.com
Blog
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectAboutHow we rankPressMCP server
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
go-validator avatar

go-validator/validator

0
View on GitHub↗
1,335 stars·124 forks·Go·Apache-2.0·6 views

Validator

This project is a data validation framework for the Go programming language that enforces integrity by applying declarative constraints to struct fields. It utilizes reflection to inspect data structures at runtime, mapping field-level requirements defined in struct tags to specific validation logic.

The library distinguishes itself through its ability to handle complex object graphs by recursively traversing nested structures and slices. It supports context-aware validation, allowing developers to switch between different rule sets for the same data structure based on application state or specific requirements.

Beyond standard field checks, the framework provides a registry-based system for defining custom validation functions. This allows for the integration of specialized business logic to handle complex data verification tasks, such as sanitizing incoming API request payloads or enforcing unique constraints across an application.

Features

  • Data Validation Frameworks - Provides a framework for verifying application data against predefined business logic requirements and complex field-level constraints.
  • Go Validation Libraries - Enforces data integrity by applying declarative constraints and custom validation rules to struct fields using tags.
  • Struct Tag Validators - Checks data fields against predefined constraints using tags to ensure that all values meet specific business logic requirements.
  • Custom Field Validation - Registers custom functions to perform specialized checks on data fields that go beyond standard validation requirements.
  • Contextual Validation Groups - Applies different sets of validation rules to the same data structure depending on the specific application state or user role requirements.
  • Reflection-Based Field Matchers - Traverses object hierarchies dynamically to access and evaluate field values against defined validation rules without manual boilerplate.
  • Data Sanitization Utilities - Validates incoming data payloads in web services to ensure that all fields conform to expected formats before processing.
  • Context-Aware Validation - Supports multiple validation rule sets for the same data structure based on application state or context.
  • Custom Validation Functions - Extends validation capabilities by defining user-provided functions that apply specialized data checks to fields.
  • Function Registries - Maintains a central lookup table of validation functions that allows developers to register and invoke custom business rules.
  • Struct Tags - Uses reflection to parse custom struct tags at runtime, mapping field constraints to specific validation logic.
  • Recursive Struct Traversal - Walks through nested data structures and slices to apply validation rules to every element within a complex object graph.
  • Field Constraints - Applies declarative rules to data structures to ensure that all values meet specific criteria such as length, range, or pattern matching.
  • Pluggable Rule Sets - Configures multiple validation rule sets for the same data structure to apply different constraints based on application state.
  • Custom Logic Validation - Extends standard data verification by registering specialized functions to handle complex business rules that go beyond basic checks.

Star history

Star history chart for go-validator/validatorStar history chart for go-validator/validator

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Curated searches featuring Validator

Hand-picked collections where Validator appears.
  • a library for model attribute validation
  • API error handling

Frequently asked questions

What does go-validator/validator do?

This project is a data validation framework for the Go programming language that enforces integrity by applying declarative constraints to struct fields. It utilizes reflection to inspect data structures at runtime, mapping field-level requirements defined in struct tags to specific validation logic.

What are the main features of go-validator/validator?

The main features of go-validator/validator are: Data Validation Frameworks, Go Validation Libraries, Struct Tag Validators, Custom Field Validation, Contextual Validation Groups, Reflection-Based Field Matchers, Data Sanitization Utilities, Context-Aware Validation.

What are some open-source alternatives to go-validator/validator?

Open-source alternatives to go-validator/validator include: asaskevich/govalidator — [Go] Package of validators and sanitizers for strings, numerics, slices and structs. go-playground/validator — This is a Go struct validation library used to maintain data integrity by enforcing constraints on fields, slices, and… keats/validator — This library is a declarative validation framework for Rust that enforces data integrity and business rules on… go-ozzo/ozzo-validation — ozzo-validation is a programmable data validation library for Go that verifies structs, maps, and primitive types… julian/jsonschema — This project is a Python implementation of the JSON Schema specification, providing a library for verifying that data… mitchellh/mapstructure — mapstructure is a reflection-based library for the bidirectional encoding and decoding of generic map data into native…

Open-source alternatives to Validator

Similar open-source projects, ranked by how many features they share with Validator.
  • asaskevich/govalidatorasaskevich avatar

    asaskevich/govalidator

    6,203View on GitHub↗

    Go Package of validators and sanitizers for strings, numerics, slices and structs

    Gogogovalidatorsanitization
    View on GitHub↗6,203
  • go-playground/validatorgo-playground avatar

    go-playground/validator

    20,028View on GitHub↗

    This is a Go struct validation library used to maintain data integrity by enforcing constraints on fields, slices, and maps. It functions as a schema validation tool and data integrity validator, ensuring that complex nested structures adhere to predefined rules. The library utilizes struct tags to configure validation logic at runtime and supports a custom function registry for extending validation rules. It is distinguished by its ability to perform cross-field dependency evaluation, allowing the comparison of values between different fields within the same data structure to ensure logical

    Goerror-handlingtranslationvalidation
    View on GitHub↗20,028
  • keats/validatorKeats avatar

    Keats/validator

    2,488View on GitHub↗

    This library is a declarative validation framework for Rust that enforces data integrity and business rules on structured data models. It utilizes procedural macros to transform attribute-based annotations into executable validation logic, ensuring that data structures adhere to defined constraints before processing. The framework distinguishes itself by performing validation at compile time, which eliminates runtime overhead and provides strict type checking for all rules. It supports recursive traversal of nested data structures and collections, ensuring that every level of a hierarchy is v

    Rust
    View on GitHub↗2,488
  • go-ozzo/ozzo-validationgo-ozzo avatar

    go-ozzo/ozzo-validation

    4,072View on GitHub↗

    ozzo-validation is a programmable data validation library for Go that verifies structs, maps, and primitive types using a declarative, rule-based approach. It functions as an interface-based validator, allowing for the recursive checking of nested data structures and custom types without the use of struct tags. The framework distinguishes itself as a context-aware validation engine, supporting the propagation of request-scoped data to rules that depend on external state. It provides extensive extensibility through custom rule definitions and the ability to override default failure text with l

    Gogogolangozzo
    View on GitHub↗4,072
See all 30 alternatives to Validator→