Releases: acronis/go-raml
v2.0.10
What's Changed
- Fix issue with self-recursive traits and add validation by @yury-palyanitsa in #78
Full Changelog: v2.0.9...v2.0.10
v2.0.9
What's Changed
- feat: Allow dots in identifier and improve tests by @yury-palyanitsa in #77
Full Changelog: v2.0.8...v2.0.9
v2.0.8
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
What's Changed
- fix: Fix required custom facet validation for descendants by @yury-palyanitsa in #75
Full Changelog: v2.0.6...v2.0.7
v2.0.6
v2.0.5
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
What's Changed
- fix: Fix potential infinite recursion during inheritance by @yury-palyanitsa in #71
Full Changelog: v2.0.3...v2.0.4
v2.0.3
What's Changed
- refactor: Make RAML.unwrapTarget method public by @yury-palyanitsa in #70
Full Changelog: v2.0.2...v2.0.3
v2.0.2
What's Changed
- JSON schema improvements and refactoring by @yury-palyanitsa in #69
Full Changelog: v2.0.1...v2.0.2
v2.0.1
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.
- The converter outputs a generic JSON Schema of type
JSONSchemaGeneric[T any], whereJSONSchemaGenericis a plain JSON Schema andTis 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. - Added
WithWrapper(f WrapperFunc[T])option forJSONSchemaConverter. If not specified, the converter must be constructed withNewJSONSchemaConverter[*JSONSchema]()that will output plain JSON Schema without RAML extensions (annotations, user-defined facets and their values). For more details, see the definition ofJSONSchematype 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. - 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. NewJSONSchemaConverternow 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