Releases: pb33f/libopenapi
v0.18.3
This fixes vacuum rules that lookup operations in the index where:
The original spec (root.yaml) has an external reference to a file in a different directory ./paths/mypath.yaml
In that location, there is a relative reference to a path-item in a nearby file, e.g. ./components.yaml#/path-item
What was previously happening in [2] is that the ./components.yaml was being resolved in ./components.yaml (the parent directory) instead of ./paths/components.yaml (the right directory). This resulted in a failure to evaluate path item references and unexpected linting failures.
This changes adjusts the lookup to search through the index's nodeMap to find the location of the YAML $ref node value that's been evaluated. Once we find it, we lookup the associated index of that file and do a seek in that specific index.
We also fix a race condition with resolving the specification asyncronously -- if we are going to an external ref we must do it sequentially as otherwise an index might be added multiple times during an async FindComponent call. This latent bug was exposed as we tested this.
v0.18.1
Fixes a small off by one error in the resolver.
Also adds extension support to server variables that was missing, courtesy of @geffersonFerraz
v0.18.0
Fixes some memory issues with string allocations. Utility functions were causing a surge of memory when run repeatedly.
Also upgrades the rolodex to use the real name of the root file, instead of 'root.yaml'
Fixes an error that was hard-coded into the License
object. Also adds Extensions
to License
and Contact
objects.
No breaking changes, no signature changes.,
v0.17.0
Support for go 1.23
and the new range over function
https://tip.golang.org/wiki/RangefuncExperiment feature.
A selection of new methods have been added to the orderedmap
package.
FromOldest()
FromNewest()
KeysFromNewest()
ValuesFromNewest()
KeysFromOldest()
ValuesFromOldest()
This allows the range
method to be used to iterate ordered maps.
Previously
for pair := orderedmap.First(schema.Properties.Value); pair != nil; pair = pair.Next() {
buildProps(pair.Key(), pair.Value(), props, 0)
}
In v0.17+
for name, schemaProxy := range schema.Properties.Value.FromOldest() {
buildProps(name, schemaProxy, props, 0)
}
v0.16.14
Better error handling for json
package.
And included pathItems
in datamodel for all v3+ (not sure how I missed this).
v0.16.12
Adds a new set of features to low level models. All nodes for a model are now captured when the model is built. Also some small gaps were covered at the low level.
No breaking changes.
v0.16.11
This fixes an issues where the schema level examples were wrongly being extracted and didn't properly match the shape of the top level named examples.
No new features, no other fixes.
v0.16.10
No features or fixes, just adds a small nil check to upgraded lookup code in utils.
v0.16.9
Bugfixes, hardening and tuneups.
Fixes:
Adds GetKeyNode and GetRootNode methods to low level models. Useful for interfaces in downstream applications.
A general tuneup in various places after hammering the library as part of a larger stack of applications.
go-yaml currently panics when trying to render the test case. So we've got to short-circuit the "empty node" to not use Encode to copy across the empty scalar node, but just set the value explicitly
Removed golang.org/ x package in favour of the std lib
v0.16.8
This release adds support to call the DisableRequiredCheck function on SchemaRenderer from the mock generator to allow rendering examples for all properties, regardless of their required status.