Skip to content

Releases: acronis/go-raml

v2.0.10

25 Mar 13:58
8db6ca1

Choose a tag to compare

What's Changed

Full Changelog: v2.0.9...v2.0.10

v2.0.9

22 Jan 13:01
849973e

Choose a tag to compare

What's Changed

Full Changelog: v2.0.8...v2.0.9

v2.0.8

16 Sep 14:57
1ffecba

Choose a tag to compare

What's Changed

  • fix: Revert custom facet validation and inherit custom shape facets instead by @yury-palyanitsa in #76

Full Changelog: v2.0.7...v2.0.8

v2.0.7

16 Sep 10:01
0bc89c3

Choose a tag to compare

What's Changed

Full Changelog: v2.0.6...v2.0.7

v2.0.6

14 Aug 14:05
49f56a4

Choose a tag to compare

What's Changed

Full Changelog: v2.0.5...v2.0.6

v2.0.5

14 Aug 08:59
2983560

Choose a tag to compare

What's Changed

  • fix: Fix missing facets for inline arrays and move SetShape to MakeConcreteShapeYAML by @yury-palyanitsa in #72
  • Refactor stacktrace.Position pass and improve YAML nodes check in scalar types by @yury-palyanitsa in #73

Full Changelog: v2.0.4...v2.0.5

v2.0.4

12 Aug 07:11
9f37666

Choose a tag to compare

What's Changed

Full Changelog: v2.0.3...v2.0.4

v2.0.3

05 Aug 13:17
1eefe79

Choose a tag to compare

What's Changed

Full Changelog: v2.0.2...v2.0.3

v2.0.2

07 Jul 11:26
7935796

Choose a tag to compare

What's Changed

Full Changelog: v2.0.1...v2.0.2

v2.0.1

02 Jul 12:16
e9e3a51

Choose a tag to compare

Breaking changes

Updated JSON Schema extensions structure

To better match RAML structure, the Custom (x-custom) field was removed and reorganized into dedicated fields for each extension domain:

  • Annotations (x-annotations) now holds an ordered map of annotations.
  • FacetDefinitions (x-facet-definitions) now holds an ordered map of JSON Schemas.
  • FacetData (x-facet-data) now holds an ordered map of traits values.

For more details, see updated definition of RAML JSON Schema in https://github.com/acronis/go-raml/blob/main/schema.go#L85.

Generalized JSON Schema converter

JSONSchemaConverter has been changed to support extensible JSON Schema structures via generics and, therefore, the default behavior has changed.

  1. The converter outputs a generic JSON Schema of type JSONSchemaGeneric[T any], where JSONSchemaGeneric is a plain JSON Schema and T is an extended JSON Schema for all its nested schemas. For more details, see the definition in https://github.com/acronis/go-raml/blob/main/schema.go#L17.
  2. Added WithWrapper(f WrapperFunc[T]) option for JSONSchemaConverter. If not specified, the converter must be constructed with NewJSONSchemaConverter[*JSONSchema]() that will output plain JSON Schema without RAML extensions (annotations, user-defined facets and their values). For more details, see the definition of JSONSchema type in https://github.com/acronis/go-raml/blob/main/schema.go#L77. For an example of a wrapper function, see https://github.com/acronis/go-raml/blob/main/schema.go#L94.
  3. By specifying your own generic via JSONSchemaGeneric[T any] and creating a wrapper function, you can collect your custom annotations in a concrete struct. See an example for custom RAML fields in JSON Schema in https://github.com/acronis/go-raml/blob/main/schema.go#L85.
  4. NewJSONSchemaConverter now returns an error in case a concrete type is specified for the constructor, but no wrapper function was specified.

For usage, see an example in https://github.com/acronis/go-raml/blob/main/parse_test.go#L31.

Full Changelog: v1.23.0...v2.0.1