Skip to content

Releases: pb33f/libopenapi

v0.18.3

08 Oct 02:09
Compare
Choose a tag to compare

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.

@ThomasRooney

v0.18.1

11 Sep 15:33
Compare
Choose a tag to compare

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

09 Sep 23:02
Compare
Choose a tag to compare

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.,

@lobocv

v0.17.0

26 Aug 19:50
Compare
Choose a tag to compare

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)
}

@TristanSpeakEasy

v0.16.14

07 Aug 18:57
Compare
Choose a tag to compare

Better error handling for json package.

And included pathItems in datamodel for all v3+ (not sure how I missed this).

@TristanSpeakEasy

v0.16.12

05 Aug 13:31
Compare
Choose a tag to compare

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

30 Jul 14:55
Compare
Choose a tag to compare

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.

#312

No new features, no other fixes.

@TristanSpeakEasy

v0.16.10

09 Jul 17:46
Compare
Choose a tag to compare

No features or fixes, just adds a small nil check to upgraded lookup code in utils.

v0.16.9

08 Jul 14:18
Compare
Choose a tag to compare

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

@ThomasRooney
@emilien-puget

v0.16.8

24 May 19:26
Compare
Choose a tag to compare

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.

@martinsirbe