OpenAPI and AsyncAPI types are often formatted as YAML instead of JSON. In the past we have simply converted it, because all of our parsing was assuming JSON. In v3 this has been changed so that we honor the content type provided to us. So now we simply store the content as-is. If you give us YAML we'll give that back to you. If you give us JSON then we'll store that.
This does not work for other JSON based types, since Avro and JSON Schema are not typically formatted as YAML files.
Supporting this required the introduction of a new interface called TypedContent to make it easier to pass the content around to various classes (Canonicalizer, Validator, etc) that need to have the content and the contentType.
The changes are mostly to support getting this test to pass:
OpenAPI and AsyncAPI types are often formatted as YAML instead of JSON. In the past we have simply converted it, because all of our parsing was assuming JSON. In v3 this has been changed so that we honor the content type provided to us. So now we simply store the content as-is. If you give us YAML we'll give that back to you. If you give us JSON then we'll store that.
This does not work for other JSON based types, since Avro and JSON Schema are not typically formatted as YAML files.
Supporting this required the introduction of a new interface called
TypedContent
to make it easier to pass the content around to various classes (Canonicalizer, Validator, etc) that need to have the content and the contentType.The changes are mostly to support getting this test to pass:
https://github.com/Apicurio/apicurio-registry/pull/4739/files#diff-2dc524c744a0171e2b44f95bc92ba63edae6f7685363812aa4a3560eb00fcbf3