swagger-editor icon indicating copy to clipboard operation
swagger-editor copied to clipboard

New release doesn't support Yaml's Merge Key Language-Independent Type "<<:"

Open karamThebian opened this issue 3 years ago • 2 comments

whenever we try to use the <<: operator, swagger editor returns : Structural error at components.schemas.AddressObject.properties.AddressID should NOT have additional properties additionalProperty: <<

image

karamThebian avatar Jun 16 '22 09:06 karamThebian

Same thing here, except that in addition it's complaining of duplicated mapping keys when using multiple merge keys on the same object.

image

I've changed the property names for pasting the example but this spec has not changed in a while and it was working properly on Swagger Editor before.

Please note that it's working fine when I use this Swagger Viewer chrome extension, which is probably using an older version of Swagger Editor.

Jeffersus avatar Jun 21 '22 17:06 Jeffersus

Unfortunately, I'm having the same issue here:

image

I had to downgrade back to swagger editor v 4.2.7 inorder to run my application...

karamThebian avatar Nov 17 '22 12:11 karamThebian

Hi everybody,

This regression comes actually from SwaggerUI (commit), which needed to load YAML definitions using JSON Schema ruleset.

JSON Schema rule-set is one of the constraints for creating OpenAPI definitions in YAML 1.2. Here is the excerpt from OpenAPI spec:

image

Having said that, Merge Key Language-Independent Type for YAML™ Version 1.1 has been removed from YAML 1.2.x spec and shouldn't be used any more. Here is the YAML 1.2 changelog excerpt which explicitly states that this feature has been removed:

image


We will unfortunately not be introducing the Merge Key Language-Independent Type for YAML™ Version 1.1 back. Even new SwaggerEditor@next (https://editor-next.swagger.io/) will not support it as well (it will support anchors and aliases in future). I'm sorry for this bad news, you would have to migrate your definitions to YAML 1.2, using JSON Schema ruleset for everything to be working as expected.

char0n avatar Nov 17 '22 14:11 char0n

I'm closing this, please reopen if you need guidance for migrating out of Merge Key Language-Independent Type for YAML™ Version 1.1.

char0n avatar Nov 21 '22 08:11 char0n