Skip to content

v0.5.0 Schema index much improved

Choose a tag to compare

@daveshanley daveshanley released this 28 Jan 19:12
· 1252 commits to main since this release

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