Ad

gojsonschema: Go JSON Schema validator

gojsonschema validates JSON documents against JSON Schemas (draft 4, 6, and 7), providing Go implementations for schema loading, validation, and error handling.
Screenshot of xeipuuv/gojsonschema homepage

gojsonschema implements the JSON Schema specification for the Go programming language. It allows developers to define schemas for JSON data and validate documents against these schemas. The project addresses the need for robust data validation in Go applications, ensuring data integrity and consistency.

The library supports multiple JSON Schema drafts (4, 6, and 7) and offers flexible schema loading options including file paths, HTTP references, and custom Go types. It includes comprehensive error reporting and metadata validation capabilities. The design prioritizes extensibility through loaders and error handling.

  • Schema Loading: Supports file, HTTP, and custom Go type schemas.
  • Draft Support: Validates against JSON Schema drafts 4, 6, and 7.
  • Error Handling: Provides detailed and informative validation error reporting.
  • Meta-Schema Validation: Enables validation of schemas against their meta-schema.
  • Custom Error Codes: Supports custom error codes for fine-grained error handling.
  • Flexibility: Offers various options for specifying drafts and auto-detection.
  • Developer Experience: Features clear usage examples and comprehensive documentation.

gojsonschema is an active project with recent commits and ongoing maintenance. It has a moderate level of community support and thorough documentation. The library has been tested and used in various applications. The usage of meta-schema validation and custom error handling provides additional flexibility and improved error messages.

Developers who need to validate JSON data in Go can benefit from gojsonschema. Its use cases include API validation, data integrity checks, and ensuring data conforms to predefined structures. It offers a robust and flexible solution compared to manual validation or relying on external validation libraries.

Languages:
Summarize:
Share:
Stars
2,737
Forks
372
Issues
143
Created
13 years ago
Commit
2 years ago
License
None
Archived
No
Updated 24 days ago

Similar Repositories