https://github.com/pb33f/libopenapi-validator
OpenAPI validation extension for libopenapi, validate http requests and responses as well as schemas
https://github.com/pb33f/libopenapi-validator
go golang http openapi openapi-spec openapi-specification openapi3 openapi3-1 openapi3-validation openapi31 schema validation validator
Last synced: 10 months ago
JSON representation
OpenAPI validation extension for libopenapi, validate http requests and responses as well as schemas
- Host: GitHub
- URL: https://github.com/pb33f/libopenapi-validator
- Owner: pb33f
- License: mit
- Created: 2023-03-31T11:28:11.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-10T11:34:50.000Z (11 months ago)
- Last Synced: 2025-04-01T09:19:59.101Z (10 months ago)
- Topics: go, golang, http, openapi, openapi-spec, openapi-specification, openapi3, openapi3-1, openapi3-validation, openapi31, schema, validation, validator
- Language: Go
- Homepage: https://pb33f.io/libopenapi/validation/
- Size: 537 KB
- Stars: 82
- Watchers: 3
- Forks: 27
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Enterprise grade OpenAPI validation tools for golang.

[](https://codecov.io/gh/pb33f/libopenapi-validator)
[](https://discord.gg/x7VACVuEGP)
[](https://pkg.go.dev/github.com/pb33f/libopenapi-validator)
A validation module for [libopenapi](https://github.com/pb33f/libopenapi).
`libopenapi-validator` will validate the following elements against an OpenAPI 3+ specification
- *http.Request* - Validates the request against the OpenAPI specification
- *http.Response* - Validates the response against the OpenAPI specification
- *libopenapi.Document* - Validates the OpenAPI document against the OpenAPI specification
- *base.Schema* - Validates a schema against a JSON or YAML blob / unmarshalled object
👉👉 [Check out the full documentation](https://pb33f.io/libopenapi/validation/) 👈👈
---
## Installation
```bash
go get github.com/pb33f/libopenapi-validator
```
## Documentation
- [The structure of the validator](https://pb33f.io/libopenapi/validation/#the-structure-of-the-validator)
- [Validation errors](https://pb33f.io/libopenapi/validation/#validation-errors)
- [Schema errors](https://pb33f.io/libopenapi/validation/#schema-errors)
- [High-level validation](https://pb33f.io/libopenapi/validation/#high-level-validation)
- [Validating http.Request](https://pb33f.io/libopenapi/validation/#validating-httprequest)
- [Validating http.Request and http.Response](https://pb33f.io/libopenapi/validation/#validating-httprequest-and-httpresponse)
- [Validating just http.Response](https://pb33f.io/libopenapi/validation/#validating-just-httpresponse)
- [Validating HTTP Parameters](https://pb33f.io/libopenapi/validation/#validating-http-parameters)
- [Validating an OpenAPI document](https://pb33f.io/libopenapi/validation/#validating-an-openapi-document)
- [Validating Schemas](https://pb33f.io/libopenapi/validation/#validating-schemas)
[libopenapi](https://github.com/pb33f/libopenapi) and [libopenapi-validator](https://github.com/pb33f/libopenapi-validator) are
products of Princess Beef Heavy Industries, LLC