Skip to content

Releases: pb33f/libopenapi

v0.31.1

30 Dec 15:07

Choose a tag to compare

Adds support for the last remaining (and pretty obscure JSON Schema props that were not being collected and parsed by the lib.

$comment, contentSchema and $vocabulary All now supported correctly. This brings libopenapi into total compliance with JSON Schema 2020-12. All the things! we have all the things, finally.

Also the mock renderer now correctly listens for preferred names on examples. Fixed by @eridan-ltu

The bundler now has a StrictValidation field on BundleCompositionConfig that handles errors during a bundle composition.
#482 @tx3stn

v0.31.0

23 Dec 16:09

Choose a tag to compare

Support for overlays added.

Resolves issue #125

Docs and examples: https://pb33f.io/libopenapi/overlays/
Overlays specification: https://spec.openapis.org/overlay/v1.0.0.html

v0.30.5

22 Dec 16:35

Choose a tag to compare

Address #309
Address #471
Addresses: daveshanley/vacuum#485

v0.30.4

20 Dec 01:45

Choose a tag to compare

Addresses non-deterministic behavior in reference extraction and resolution by introducing deterministic ordering through map key sorting, using singleflight for deduplication of concurrent lookups, and upgrading to RWMutex for better concurrency control.

Implements deterministic ordering by sorting map keys before iteration across multiple index operations. Adds singleflight pattern to deduplicate concurrent reference lookups and reduce contention. Changes refLock from sync.Mutex to sync.RWMutex to allow concurrent reads

Fixed a bug where parameters were being dropped during YAML rendering. The skip flag wasn't being reset at the start of each slice iteration, causing newly created high-level objects (without low-level models) to be incorrectly skipped.

v0.30.3

19 Dec 15:52

Choose a tag to compare

Fixed a rogue import from an older yaml library. No breaking changes or new features.

v0.30.2

18 Dec 22:22

Choose a tag to compare

Adds a context aware version of RenderYAMLInline to all objects that support it in the high-level model. Now context is available to be passed down and is used to prevent cycles from being detected when running async builds.

No breaking changes.

v0.30.1

17 Dec 20:34

Choose a tag to compare

Adds support for $dynamicRef and $dynamicAnchor across the library.

Address issue #267

v0.30.0

17 Dec 15:25

Choose a tag to compare

Fixing, adding, solving, doing, making.

This PR introduces v0.30 with significant enhancements to the breaking rules system, concurrency improvements in the indexing layer, and API additions for programmatic spec building. The main changes include:

  • Refactored breaking rules to be fully configurable with validation
  • Added reference support to high-level v3 types for better spec construction
  • Improved concurrency handling in rolodex file loading to prevent deadlocks
  • Updated test assertions to reflect corrected breaking change counts

Key Changes

  • Introduced configurable breaking rules system with YAML validation
  • Added CreateXRef() helper functions for Parameter, Response, RequestBody, PathItem, Header, Link, Callback, and SecurityScheme
  • Fixed circular reference deadlocks in rolodex by coordinating indexing with context tracking
  • Refactored PropertyCheck creation across 20+ files to use NewPropertyCheck helper

Docs updated:

https://pb33f.io/libopenapi/bundling/#advanced-inline-bundling
https://pb33f.io/libopenapi/modifying/#using-references
https://pb33f.io/libopenapi/what-changed/#configurable-breaking-change-rules

Fixes

v0.29.1

13 Dec 17:15

Choose a tag to compare

Adds additional 3.2 properties that I missed during dev, discovered when testing upstream.

Docs also available https://pb33f.io/libopenapi/what-changed/#configurable-breaking-change-rules

v0.29.0

12 Dec 21:25

Choose a tag to compare

Configurable Breaking Change Rules

New Feature

  • Configurable breaking change detection - All breaking change rules are now configurable instead of hardcoded, allowing users to customize what is considered a breaking change for their use case

New Files

  • breaking_rules.go - Core API functions (GenerateDefaultBreakingRules(), IsBreakingChange(), BreakingAdded/Modified/Removed())
  • breaking_rules_model.go - Type definitions for all component rules (Schema, Operation, Parameter, etc.)
  • breaking_rules_config.go - Configuration management with Merge() and IsBreaking() lookup methods
  • breaking_rules_constants.go - Component and property name constants for type-safe lookups
  • breaking_rules_test.go

Key Capabilities

  • Global config API - SetActiveBreakingRulesConfig() / GetActiveBreakingRulesConfig() for setting custom rules
  • Sparse overrides - Users only specify rules they want to change; defaults apply for everything else
  • Merge functionality - Custom configs merge cleanly with defaults
  • Thread-safe - Uses sync.RWMutex for concurrent access
  • Cached defaults - sync.Once pattern for efficient default rule generation

Refactored Files (35+ model files)

All comparison functions now use configurable lookups instead of hardcoded booleans:

  • schema.go, operation.go, parameter.go, path_item.go, paths.go
  • header.go, media_type.go, response.go, responses.go, request_body.go
  • security_scheme.go, security_requirement.go, oauth_flows.go, callback.go
  • info.go, contact.go, license.go, tag.go, external_docs.go
  • server.go, server_variable.go, link.go, encoding.go, discriminator.go, xml.go, example.go

Backward Compatibility

  • Default behavior is unchanged - same rules as previously hardcoded
  • No breaking changes to existing API
  • Configuration is optional; if not set, defaults apply
  • Swagger 2.0 rules remain hardcoded (OpenAPI 3.x only)

Other Changes

  • Fixed issue #484
  • Bumped go.yaml.in/yaml/v4 from 4.0.0-rc.2 to 4.0.0-rc.3
  • Added edge case tests for various properties
  • Improved path handling in what-changed