Skip to content

Releases: pb33f/libopenapi

v0.18.7

18 Nov 15:19
Compare
Choose a tag to compare

Added support for OpenAPI 3.1.1 documents.

@LasneF

v0.18.6

29 Oct 15:48
Compare
Choose a tag to compare

Solves issue #333

  • Accessing GetAllComponentSchemas causes a race condition error during usage.
  • Adds a RWLock to ensure that the map object is safely created across go routines. This pattern is used for other similar fields

Add nil check on Document Render to avoid panic

Expanded the existing check during Render to generally check for a nil highOpenAPI3Model, with more specific error message depending on if it's Swagger or not.

Also added a check for the info which is a pointer, so could technically be nil.
Added a test case to ensure we error. Without my changes the test panics which we're trying to avoid.

Fix: resolve remote relative refs correctly

Some deep dark glitches in the index resulted in some random relative $ref's being missed under certain edge conditions.


This release was 100% provided by the community


@califlower @inFocus7 @felixjung

v0.18.5

23 Oct 15:58
Compare
Choose a tag to compare

Added a high level model cache that prevents the over production of schemas when walking the model.

A new cache interface and implementation have been added to index, so the cache design can be re-used anywhere else its needed as we work towards cleaning up memory use.

v0.18.4

20 Oct 19:38
Compare
Choose a tag to compare

Added GetIndex() and GetContext() to v3 low models.

Makes it much easier for downstream tools to know all the things

fix: indexing of operations which are $refs (#339)

Why
We have a linting rule which checks for duplicate operation IDs / duplicate operations. This linting rule wasn't catching duplicates if the operations were living in an external $ref.

What
Currently when building the index of operations we weren't checking for refs, this PR changes that.

@mfbx9da4

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.