addon-operator icon indicating copy to clipboard operation
addon-operator copied to clipboard

fix: support 'map merge' feature for OpenAPI schemas in YAML files

Open diafour opened this issue 3 years ago • 0 comments

Overview

go-openapi/swag package uses yaml.MapSlice type to unmarshal from YAML bytes. This type supports 'direct' anchoring (properties: *anchor) but doesn't support 'map merge' (<<: *anchor). Additional loader is added to unmarshal YAML bytes into interface{}, so 'map merge' is now supported.

Add tests to check for anchor support and also check if $ref is working.

What this PR does / why we need it

'map merge' is a convinient feature of YAML format, we use it in CRDs in deckhouse to copy and add properties between objects: OpenStackClusterConfiguration

diafour avatar Oct 13 '22 17:10 diafour