Releases: pb33f/libopenapi
v0.6.1
Minor bug fixes and updates, tuned up the index a little: no breaking changes, no new features.
v0.6.0
v0.6.0
Addresses issue #73 by introducing some enhancements to the index, allowing for relative file handling, and providing a fix to auto-allowing remote and local files to be followed.
A new configuration option is available to document creation for an Index. It's defined as index.SpecIndexConfig
and provides three properties:
BaseURL
of type*url.URL
AllowRemoteLookup
of typebool
AllowFileLookup
of typebool
This can be used to configure an index to know where to look when encountering relative paths and if to allow them at all.
Full documentation can be found here.
When creating a new Document
, there is also a new datamodel.DocumentConfigutation
, which looks almost identical, except
for the Lookup postfix has been replaced with References
config := datamodel.DocumentConfiguration{
AllowFileReferences: true,
AllowRemoteReferences: true,
BaseURL: baseURL,
}
This new config can be used with a new function called NewDocumentWithConfiguration()
that is the same as NewDocument()
except it has a second argument for accepting the config.
doc, err := NewDocumentWithConfiguration(digitalOcean, &config)
Full documentation can be found here.
The index has been refactored a little to help make it easier to navigate and tuned up to run faster when indexing references.
The digital ocean spec has been added for testing purposes.
v0.5.0 Schema index much improved
Schema indexing has been cleaned up and improved to resolve #50.
There is new code that looks for inline schema definitions and collects them and a further subset of references that are precisely object or array types.
This is a breaking change
The index.GetAllSchemas()
method now returns a slice of *Reference
pointers, rather than a map of them. The original behavior of GetAllSchemas()
has been replaced with GetAllComponentSchemas()
, which retains the signature.
Two new additional methods GetAllInlineSchemas()
and GetAllInlineSchemaObjects()
. The former will return everything in the spec marked with schema that is not a reference. The latter will return everything the former does, except filtered down by object or array types.
Also, the index is now bubbled up through the document model. There isn't a simple way to get access to it. A small non-breaking change that attaches a reference to the index, returned by DocumentModel
v0.4.14 Circular reference upgrade.
Circular references can now be treated as 'non-infinite' circles. This is defined by a Schema
being required
or not. If a Schema
is not required, it's not marked as an infinite loop.
This allows specs that have circles built in by default, but are not 'incorrect' in the fact that they are not required loops.
`AllOf` retains original ordering
v0.4.13 fix: remove debug logging
v0.4.10 What Changed fixes.
Various tweaks to improve some panics and failures with what changed.
v0.4.8
v0.4.7
Improves index handling of servers.
v0.4.3
Fixes a memory leak when using libopenapi
with large numbers of specs.
v0.4.0
v0.4.0
Updates the base.Schema
for both high and low-level models to fix some inaccuracies and introduce missing properties for JSON Schema / v3.1
What was added
if
else
then
propertyNames
contains
minContains
maxContains
unevaluatedItems
unevaluatedProperties
dependentSchemas
patternProperties
What changed
DynamicValue
was added as a container for values with differing types. This follows the same pattern established in the low level model.
Items
can now be a SchemaProxy
or a bool
(using DynamicValue
), no longer a slice.
Not
is also no longer a slice.
ExclusiveMinimum
and ExclusiveMaximum
are now DynamicValue
pointers that can be either a bool
or int64
The ExclusiveMinimumBool
and ExclusiveMaximumBool
properties have been removed as they are now combined.
These are breaking changes, but it does set a standard for how to proceed.