Skip to content

Releases: pb33f/libopenapi

v0.10.3

14 Sep 11:34
Compare
Choose a tag to compare

Added Render method to document

Previously RenderAndReload was the only way to print out the document as a byte slice, and then have a new model created from that rendered document.

A use-case has appeared, where a non-destructive approach is required for high-level use where a render is needed, but any manipulation of the model will cause issues.

So a new Render method has been added, that does everything RenderAndReload does, except it does not reload.

WARNING

The high and low level models will remain out of sync after rendering. This is totally fine if you don't use the low level model, but if you do, then remember that the render is of the mutated high-level and the low-level will not match, it will reference the original document, before mutation.

Added `const` to `Schema`

13 Sep 10:15
Compare
Choose a tag to compare

A missing property is no longer missing.

No new features, no other fixes.

@TristanSpeakEasy

v0.10.1

01 Sep 10:06
Compare
Choose a tag to compare

New mock/example renderer is now available for all v3 base.Schema entities and any other high level object that contains Examples or Example or a Schema / SchemaProxy

Based on PR #162

Here is an example of how to use it.

  // create a new YAML mock generator
    mg := NewMockGenerator(JSON)

    burgerShop, _ := os.ReadFile("../test_specs/burgershop.openapi.yaml")

    // create a new document from specification and build a v3 model.
    document, _ := libopenapi.NewDocument(burgerShop)
    v3Model, _ := document.BuildV3Model()

    // create a mock of the Fries model
    friesModel := v3Model.Model.Components.Schemas["Fries"]
    fries := friesModel.Schema()
    mock, err := mg.GenerateMock(fries, "")

    if err != nil {
        panic(err)
    }
    fmt.Println(string(mock))
    // Output: {"favoriteDrink":{"drinkType":"coke","size":"M"},"potatoShape":"Crispy Shoestring"}

Documentation is coming soon to https://quobix.com/vacuum/

v0.10.0

25 Aug 13:54
Compare
Choose a tag to compare

Low-level schemas now have access to the key node, which was missing before.

This is a breaking change with some low-level APIs, which is why the minor version bump.

Authored by @bitomaxsp

v0.9.9

22 Aug 10:48
74c7a3f
Compare
Choose a tag to compare

GetAllSchemas() from the index now picks up a lot more previously disregarded schemas throughout the document(s).

@TristanSpeakEasy @2ynn

v0.9.8

09 Aug 11:42
Compare
Choose a tag to compare

Adds a new GetAllReferenceSchemas method to the index that allows any schema defined by a $ref to be picked up. And then this new set of discoveries is now rolled up into GetAllSchemas

It also fixes a minor bug with hashing nil values.

No breaking changes, no new features.

v0.9.7

30 Jul 08:31
Compare
Choose a tag to compare

Minor bugfix for ensuring low-level nodes are ignored when being rendered. no breaking changes, no new features.

v0.9.5

21 Jul 15:40
Compare
Choose a tag to compare

Small bugfix for #145, No breaking changes, no new features.

v0.9.4

18 Jul 18:46
Compare
Choose a tag to compare

Adds more support for complex example type checking in what-changed. No new features.

v0.9.3

16 Jul 15:46
Compare
Choose a tag to compare

Building in new non-breaking features: