Skip to content

Releases: pb33f/libopenapi-validator

v0.10.1

31 Dec 19:33

Choose a tag to compare

Adds in line and column tracking for untracked errors, as well as allows passthrough of security schemes. This is a breaking change, however the new feature is less than 24 hours old and it's also new years eve. If you're coding right now, whats wrong with you.

I am fully aware of the irony of that.

Anyway, this feature is wired up in vacuum and wiretap and is operational now.

v0.10.0

30 Dec 23:04

Choose a tag to compare

Strict mode is an optional validation feature that detects undeclared properties in API requests and responses, even when the OpenAPI schema would normally allow them via additionalProperties: true.

In standard JSON Schema validation, setting additionalProperties: true (or omitting it entirely) permits any extra properties beyond those explicitly defined.

Strict mode overrides this permissive behavior to enforce API governance, ensuring that clients only send properties explicitly documented in the OpenAPI specification.

It supports configurable ignore patterns (using glob syntax like $.body.metadata.*) to exclude specific paths, and has sensible defaults for common HTTP headers that are typically not documented in specs.

Strict mode respects readOnly and writeOnly semantics based on whether validation is for a request or response.

https://pb33f.io/libopenapi/validation/#strict-mode-validation

v0.9.4

18 Dec 23:06

Choose a tag to compare

Adds new inline rendering function that provides context from libopenapi. Also bumps deps and adds error checking for circular references or anything that fails schema rendering to requests and responses.

v0.9.3

02 Dec 11:17

Choose a tag to compare

Added a new --yaml2json flag to executable version of the lib to handle JSON encoding issues with yaml.

@reversearrow

v0.9.2

08 Nov 13:41

Choose a tag to compare

Added a new XMLValidator interface and the ability validate (in a simple mechanism) XML is valid.

// XMLValidator is an interface that defines methods for validating XML against OpenAPI schemas.
// There are 2 methods for validating XML:
//
//	ValidateXMLString validates an XML string against a schema, applying OpenAPI xml object transformations.
//	ValidateXMLStringWithVersion - version-aware XML validation that allows OpenAPI 3.0 keywords when version is specified.
type XMLValidator interface {
	// ValidateXMLString validates an XML string against an OpenAPI schema, applying xml object transformations.
	// Uses OpenAPI 3.1+ validation by default (strict JSON Schema compliance).
	ValidateXMLString(schema *base.Schema, xmlString string) (bool, []*liberrors.ValidationError)

	// ValidateXMLStringWithVersion validates an XML string with version-specific rules.
	// When version is 3.0, OpenAPI 3.0-specific keywords like 'nullable' are allowed and processed.
	// When version is 3.1+, OpenAPI 3.0-specific keywords like 'nullable' will cause validation to fail.
	ValidateXMLStringWithVersion(schema *base.Schema, xmlString string, version float32) (bool, []*liberrors.ValidationError)
}

v0.9.1

06 Nov 23:03

Choose a tag to compare

v0.9.0

28 Oct 20:21

Choose a tag to compare

Introduces a regex cache to the FindPath method.

It's a breaking change, but well worth it if you're using this library in long running, heavy load servers and you're seeing memory drain.

#190

@ySnoopyDogy

v0.8.1

23 Oct 22:58

Choose a tag to compare

Fixes cache warm up bug

@its-hammer-time

v0.8.0

22 Oct 15:59

Choose a tag to compare

Adds in Schema caching for long running validation.

A full breakdown of the changes.

#187

@its-hammer-time

v0.7.0

13 Oct 20:41

Choose a tag to compare

Support for considering the OpenAPI version in response.ValidateResponseSchema and request.ValidateRequestSchema.

Each function signature contains a breaking change.

In ValidateRequestSchema and ValidateResponseSchema, I think the version should ideally be passed as a parameter via config.Option, but since all other functions were passing the version as an argument, I followed suit.
(For example, the intent of the arguments of helpers.NewCompiledSchemaWithVersion becomes unclear.)

#186

@k1LoW