diff --git a/asyncapi-core/src/main/java/com/asyncapi/v3/schema/avro/v1/_9_0/jackson/AvroSchemaDeserializer.java b/asyncapi-core/src/main/java/com/asyncapi/v3/schema/avro/v1/_9_0/jackson/AvroSchemaDeserializer.java new file mode 100644 index 00000000..09398fdc --- /dev/null +++ b/asyncapi-core/src/main/java/com/asyncapi/v3/schema/avro/v1/_9_0/jackson/AvroSchemaDeserializer.java @@ -0,0 +1,59 @@ +package com.asyncapi.v3.schema.avro.v1._9_0.jackson; + +import com.asyncapi.v3.schema.avro.v1._9_0.Avro; +import com.asyncapi.v3.schema.avro.v1._9_0.AvroUnion; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.JsonNodeType; + +import java.io.IOException; + +public class AvroSchemaDeserializer extends JsonDeserializer { + + @Override + final public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException { + ObjectCodec objectCodec = p.getCodec(); + JsonNode node = objectCodec.readTree(p); + + return chooseKnownPojo(node, objectCodec); + } + + private Object chooseKnownPojo(JsonNode jsonNode, final ObjectCodec objectCodec) throws IOException { + try (JsonParser jsonParser = jsonNode.traverse(objectCodec)) { + JsonNodeType nodeType = jsonNode.getNodeType(); + + switch (nodeType) { + case ARRAY: + return readAsUnion((ArrayNode) jsonNode, objectCodec); + case OBJECT: + return jsonParser.readValueAs(Avro.class); + case STRING: + return jsonParser.readValueAs(String.class); + case BOOLEAN: + case NUMBER: + case BINARY: + case POJO: + case MISSING: + case NULL: + return null; + } + + return null; + } + } + + private AvroUnion readAsUnion(ArrayNode arrayNode, ObjectCodec objectCodec) throws IOException { + AvroUnion avroUnion = new AvroUnion(); + for (JsonNode childNode : arrayNode) { + avroUnion.add(chooseKnownPojo(childNode, objectCodec)); + } + + return avroUnion; + } + +} diff --git a/asyncapi-core/src/main/java/com/asyncapi/v3/schema/multiformat/AvroFormatSchema.java b/asyncapi-core/src/main/java/com/asyncapi/v3/schema/multiformat/AvroFormatSchema.java new file mode 100644 index 00000000..a6816e56 --- /dev/null +++ b/asyncapi-core/src/main/java/com/asyncapi/v3/schema/multiformat/AvroFormatSchema.java @@ -0,0 +1,55 @@ +package com.asyncapi.v3.schema.multiformat; + +import com.asyncapi.v3.schema.AsyncAPISchema; +import com.asyncapi.v3.schema.avro.v1._9_0.jackson.AvroSchemaDeserializer; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import lombok.EqualsAndHashCode; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * The Multi Format Schema Object represents a schema definition. It differs from the {@link AsyncAPISchema} in that it supports + * multiple schema formats or languages (e.g., JSON Schema, Avro, etc.). + * + * @see Multi Format Schema + * @see Schema + * @author Pavel Bodiachevskii + * @version 3.0.0 + */ +@EqualsAndHashCode(callSuper = true) +public class AvroFormatSchema extends MultiFormatSchema { + + public AvroFormatSchema(@NotNull @JsonDeserialize(using = AvroSchemaDeserializer.class) Object schema) { + super("application/vnd.apache.avro;version=1.9.0", schema); + } + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + public AvroFormatSchema( + @JsonProperty("schemaFormat") @Nullable String schemaFormat, + @JsonProperty("schema") @NotNull @JsonDeserialize(using = AvroSchemaDeserializer.class) Object schema + ) { + super(schemaFormat(schemaFormat), schema); + } + + @Override + public void setSchema(@NotNull Object schema) { + super.setSchema(schema); + } + + @NotNull + public Object getSchema() { + return super.getSchema(); + } + + @NotNull + private static String schemaFormat(@Nullable String schemaFormat) { + if (schemaFormat == null || schemaFormat.isEmpty()) { + return "application/vnd.apache.avro;version=1.9.0"; + } + + return schemaFormat; + } + +} diff --git a/asyncapi-core/src/main/java/com/asyncapi/v3/schema/multiformat/MultiFormatSchema.java b/asyncapi-core/src/main/java/com/asyncapi/v3/schema/multiformat/MultiFormatSchema.java index b5e2209a..f8aab37b 100644 --- a/asyncapi-core/src/main/java/com/asyncapi/v3/schema/multiformat/MultiFormatSchema.java +++ b/asyncapi-core/src/main/java/com/asyncapi/v3/schema/multiformat/MultiFormatSchema.java @@ -69,6 +69,32 @@ "application/vnd.aai.asyncapi;version=3.0.0", "application/vnd.aai.asyncapi+json;version=3.0.0", "application/vnd.aai.asyncapi+yaml;version=3.0.0" + }), + @JsonSubTypes.Type(value = AvroFormatSchema.class, names = { + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0", + "application/vnd.apache.avro;version=1.9.1", + "application/vnd.apache.avro+json;version=1.9.1", + "application/vnd.apache.avro+yaml;version=1.9.1", + "application/vnd.apache.avro;version=1.9.2", + "application/vnd.apache.avro+json;version=1.9.2", + "application/vnd.apache.avro+yaml;version=1.9.2", + "application/vnd.apache.avro;version=1.10.0", + "application/vnd.apache.avro+json;version=1.10.0", + "application/vnd.apache.avro+yaml;version=1.10.0", + "application/vnd.apache.avro;version=1.10.1", + "application/vnd.apache.avro+json;version=1.10.1", + "application/vnd.apache.avro+yaml;version=1.10.1", + "application/vnd.apache.avro;version=1.10.2", + "application/vnd.apache.avro+json;version=1.10.2", + "application/vnd.apache.avro+yaml;version=1.10.2", + "application/vnd.apache.avro;version=1.11.0", + "application/vnd.apache.avro+json;version=1.11.0", + "application/vnd.apache.avro+yaml;version=1.11.0", + "application/vnd.apache.avro;version=1.11.1", + "application/vnd.apache.avro+json;version=1.11.1", + "application/vnd.apache.avro+yaml;version=1.11.1" }) }) @EqualsAndHashCode(callSuper = true) diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/MultiFormatSchemaTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/MultiFormatSchemaTest.kt index ac1e0875..5f4132bd 100644 --- a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/MultiFormatSchemaTest.kt +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/MultiFormatSchemaTest.kt @@ -1,6 +1,7 @@ package com.asyncapi.v3.schema.multiformat import com.asyncapi.v3.schema.multiformat.asyncapi.* +import com.asyncapi.v3.schema.multiformat.avro.* import com.asyncapi.v3.schema.multiformat.json.JsonFormatSchemaTest import com.asyncapi.v3.schema.multiformat.openapi.OpenAPIFormatSchemaV3_0_0Test import com.asyncapi.v3.schema.multiformat.openapi.OpenAPIFormatSchemaV3_0_1Test @@ -60,6 +61,43 @@ class MultiFormatSchemaTest { } + @Nested + inner class AvroSchema { + + @Nested + @DisplayName("1.9.0") + inner class V1_9_0: AvroFormatSchemaV1_9_0Test() + + @Nested + @DisplayName("1.9.1") + inner class V1_9_1: AvroFormatSchemaV1_9_1Test() + + @Nested + @DisplayName("1.9.2") + inner class V1_9_2: AvroFormatSchemaV1_9_2Test() + + @Nested + @DisplayName("1.10.0") + inner class V1_10_0: AvroFormatSchemaV1_10_0Test() + + @Nested + @DisplayName("1.10.1") + inner class V1_10_1: AvroFormatSchemaV1_10_1Test() + + @Nested + @DisplayName("1.10.2") + inner class V1_10_2: AvroFormatSchemaV1_10_2Test() + + @Nested + @DisplayName("1.11.0") + inner class V1_11_0: AvroFormatSchemaV1_11_0Test() + + @Nested + @DisplayName("1.11.1") + inner class V1_11_1: AvroFormatSchemaV1_11_1Test() + + } + @Nested inner class JsonSchema { diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaTest.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaTest.kt new file mode 100644 index 00000000..af4a4912 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaTest.kt @@ -0,0 +1,36 @@ +package com.asyncapi.v3.schema.multiformat.avro + +import com.asyncapi.v3.ClasspathUtils +import com.asyncapi.v3.schema.multiformat.AvroFormatSchema +import com.fasterxml.jackson.annotation.JsonInclude +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory +import org.junit.jupiter.api.Assertions + +abstract class AvroFormatSchemaTest { + + private val objectMapper: ObjectMapper = ObjectMapper(YAMLFactory()) + .setSerializationInclusion(JsonInclude.Include.NON_NULL) + .findAndRegisterModules() + + fun compareSchemas( + avroFormatSchemaToCompareWithFilePath: String, + schemaToCheck: AvroFormatSchema + ) { + val schemaAsJson = ClasspathUtils.readAsString(avroFormatSchemaToCompareWithFilePath) + val schema = objectMapper.readValue(schemaAsJson, AvroFormatSchema::class.java) + + Assertions.assertEquals(schema, schemaToCheck) + } + + abstract fun parseJson( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) + + abstract fun parseYaml( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_10_0Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_10_0Test.kt new file mode 100644 index 00000000..fe65350c --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_10_0Test.kt @@ -0,0 +1,342 @@ +package com.asyncapi.v3.schema.multiformat.avro + +import com.asyncapi.v3.schema.avro.AvroSchemasProvider +import com.asyncapi.v3.schema.avro.v1._9_0.Avro +import com.asyncapi.v3.schema.avro.v1._9_0.AvroUnion +import com.asyncapi.v3.schema.multiformat.AvroFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AvroFormatSchemaV1_10_0Test: AvroFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.0", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.0", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.0", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_10_1Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_10_1Test.kt new file mode 100644 index 00000000..b618c349 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_10_1Test.kt @@ -0,0 +1,342 @@ +package com.asyncapi.v3.schema.multiformat.avro + +import com.asyncapi.v3.schema.avro.AvroSchemasProvider +import com.asyncapi.v3.schema.avro.v1._9_0.Avro +import com.asyncapi.v3.schema.avro.v1._9_0.AvroUnion +import com.asyncapi.v3.schema.multiformat.AvroFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AvroFormatSchemaV1_10_1Test: AvroFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.1", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.1", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.1", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_10_2Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_10_2Test.kt new file mode 100644 index 00000000..253b09ad --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_10_2Test.kt @@ -0,0 +1,342 @@ +package com.asyncapi.v3.schema.multiformat.avro + +import com.asyncapi.v3.schema.avro.AvroSchemasProvider +import com.asyncapi.v3.schema.avro.v1._9_0.Avro +import com.asyncapi.v3.schema.avro.v1._9_0.AvroUnion +import com.asyncapi.v3.schema.multiformat.AvroFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AvroFormatSchemaV1_10_2Test: AvroFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.10.2", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.10.2", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.10.2", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_11_0Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_11_0Test.kt new file mode 100644 index 00000000..ab4afe62 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_11_0Test.kt @@ -0,0 +1,342 @@ +package com.asyncapi.v3.schema.multiformat.avro + +import com.asyncapi.v3.schema.avro.AvroSchemasProvider +import com.asyncapi.v3.schema.avro.v1._9_0.Avro +import com.asyncapi.v3.schema.avro.v1._9_0.AvroUnion +import com.asyncapi.v3.schema.multiformat.AvroFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AvroFormatSchemaV1_11_0Test: AvroFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.0", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.0", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.0", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_11_1Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_11_1Test.kt new file mode 100644 index 00000000..08c002ac --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_11_1Test.kt @@ -0,0 +1,342 @@ +package com.asyncapi.v3.schema.multiformat.avro + +import com.asyncapi.v3.schema.avro.AvroSchemasProvider +import com.asyncapi.v3.schema.avro.v1._9_0.Avro +import com.asyncapi.v3.schema.avro.v1._9_0.AvroUnion +import com.asyncapi.v3.schema.multiformat.AvroFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AvroFormatSchemaV1_11_1Test: AvroFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.11.1", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.11.1", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.11.1", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_9_0Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_9_0Test.kt new file mode 100644 index 00000000..9bd6c750 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_9_0Test.kt @@ -0,0 +1,340 @@ +package com.asyncapi.v3.schema.multiformat.avro + +import com.asyncapi.v3.schema.avro.AvroSchemasProvider +import com.asyncapi.v3.schema.multiformat.AvroFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AvroFormatSchemaV1_9_0Test: AvroFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.0", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.0", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.0", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_9_1Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_9_1Test.kt new file mode 100644 index 00000000..320ba19b --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_9_1Test.kt @@ -0,0 +1,342 @@ +package com.asyncapi.v3.schema.multiformat.avro + +import com.asyncapi.v3.schema.avro.AvroSchemasProvider +import com.asyncapi.v3.schema.avro.v1._9_0.Avro +import com.asyncapi.v3.schema.avro.v1._9_0.AvroUnion +import com.asyncapi.v3.schema.multiformat.AvroFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AvroFormatSchemaV1_9_1Test: AvroFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.1", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.1", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.1", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_9_2Test.kt b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_9_2Test.kt new file mode 100644 index 00000000..ee9ee832 --- /dev/null +++ b/asyncapi-core/src/test/kotlin/com/asyncapi/v3/schema/multiformat/avro/AvroFormatSchemaV1_9_2Test.kt @@ -0,0 +1,342 @@ +package com.asyncapi.v3.schema.multiformat.avro + +import com.asyncapi.v3.schema.avro.AvroSchemasProvider +import com.asyncapi.v3.schema.avro.v1._9_0.Avro +import com.asyncapi.v3.schema.avro.v1._9_0.AvroUnion +import com.asyncapi.v3.schema.multiformat.AvroFormatSchema +import org.junit.jupiter.api.extension.ExtensionContext +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider +import org.junit.jupiter.params.provider.ArgumentsSource +import java.util.stream.Stream + +abstract class AvroFormatSchemaV1_9_2Test: AvroFormatSchemaTest() { + + @ArgumentsSource(JsonFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseJson( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + @ArgumentsSource(YamlFormat::class) + @ParameterizedTest(name = "Read: {0}") + override fun parseYaml( + avroFormatSchemaToCompareWithFilePath: String, + avroFormatSchema: AvroFormatSchema + ) { + compareSchemas(avroFormatSchemaToCompareWithFilePath, avroFormatSchema) + } + + class JsonFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro+json;version=1.9.2", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/ApplicationEvent.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/DocumentInfo.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/foo.Bar.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v1.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v2.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical-uuid.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical_types_with_multiple_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/MyResponse.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/regression_error_field_in_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-read.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-write.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/SchemaBuilder.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/simple_record.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithLogicalTypes.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithMapsAndArrays.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestUnionRecord.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/union_and_fixed_fields.json", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + + class YamlFormat: ArgumentsProvider { + + override fun provideArguments(context: ExtensionContext?): Stream { + return Stream.of( + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro+yaml;version=1.9.2", AvroSchemasProvider().unionAndFixedFields()) + ), + + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/ApplicationEvent.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().applicationEventTest()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/DocumentInfo.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().documentInfo()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/foo.Bar.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().fooBar()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v1.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().fullRecordV1()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v2.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().fullRecordV2()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical-uuid.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().logicalUUID()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical_types_with_multiple_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().logicalTypesWithMultipleFields()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/MyResponse.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().myResponse()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/regression_error_field_in_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().regressionErrorFieldInRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().schemaLocation()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-read.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().schemaLocationRead()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-write.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().schemaLocationWrite()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/SchemaBuilder.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().schemaBuilder()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/simple_record.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().simpleRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithLogicalTypes.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().testRecordWithLogicalTypes()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().testRecordWithMapsAndArrays()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestUnionRecord.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().testUnionRecord()) + ), + Arguments.of( + "/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/union_and_fixed_fields.yaml", + AvroFormatSchema("application/vnd.apache.avro;version=1.9.2", AvroSchemasProvider().unionAndFixedFields()) + ), + ) + } + + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/ApplicationEvent.json new file mode 100644 index 00000000..6784598d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/DocumentInfo.json new file mode 100644 index 00000000..addba641 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/MyResponse.json new file mode 100644 index 00000000..957b23b5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/SchemaBuilder.json new file mode 100644 index 00000000..80ae4a3f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..96317d72 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..45805cfb --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/TestUnionRecord.json new file mode 100644 index 00000000..a18d294b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/foo.Bar.json new file mode 100644 index 00000000..5996ba21 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/full_record_v1.json new file mode 100644 index 00000000..2af6e464 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/full_record_v2.json new file mode 100644 index 00000000..f0b29eb5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/logical-uuid.json new file mode 100644 index 00000000..ac1ebcfa --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..0ff839e8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/regression_error_field_in_record.json new file mode 100644 index 00000000..e2d043e9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/schema-location-read.json new file mode 100644 index 00000000..c5eebe4a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/schema-location-write.json new file mode 100644 index 00000000..1dabd345 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/schema-location.json new file mode 100644 index 00000000..53d8bfe9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/simple_record.json new file mode 100644 index 00000000..373c5467 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/union_and_fixed_fields.json new file mode 100644 index 00000000..8d17f257 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+json/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.0", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/ApplicationEvent.yaml new file mode 100644 index 00000000..2d0c9267 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/DocumentInfo.yaml new file mode 100644 index 00000000..9c5a3156 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/MyResponse.yaml new file mode 100644 index 00000000..0661e521 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/SchemaBuilder.yaml new file mode 100644 index 00000000..ffa79186 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..cc6ca4ac --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..fe5960bd --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/TestUnionRecord.yaml new file mode 100644 index 00000000..447765b9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/foo.Bar.yaml new file mode 100644 index 00000000..5bbd9250 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/full_record_v1.yaml new file mode 100644 index 00000000..2256e4c1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/full_record_v2.yaml new file mode 100644 index 00000000..0366e21b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/logical-uuid.yaml new file mode 100644 index 00000000..695eb8ea --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..103a2b4a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/regression_error_field_in_record.yaml new file mode 100644 index 00000000..552a8f35 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/schema-location-read.yaml new file mode 100644 index 00000000..0f0a092d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/schema-location-write.yaml new file mode 100644 index 00000000..64f55018 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/schema-location.yaml new file mode 100644 index 00000000..48255741 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/simple_record.yaml new file mode 100644 index 00000000..53918421 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/union_and_fixed_fields.yaml new file mode 100644 index 00000000..3679160b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro+yaml/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.0 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/ApplicationEvent.json new file mode 100644 index 00000000..94b9383a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/ApplicationEvent.yaml new file mode 100644 index 00000000..63fa67fc --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/DocumentInfo.json new file mode 100644 index 00000000..1a35ab61 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/DocumentInfo.yaml new file mode 100644 index 00000000..364460c3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/MyResponse.json new file mode 100644 index 00000000..ac17210c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/MyResponse.yaml new file mode 100644 index 00000000..fbef0d1e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/SchemaBuilder.json new file mode 100644 index 00000000..7e848a59 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/SchemaBuilder.yaml new file mode 100644 index 00000000..8ea98efb --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..bfb77ff2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..b037f7cf --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..533ac151 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..0d35c7b5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestUnionRecord.json new file mode 100644 index 00000000..a5a51429 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestUnionRecord.yaml new file mode 100644 index 00000000..86b0b054 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/foo.Bar.json new file mode 100644 index 00000000..3f0ab400 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/foo.Bar.yaml new file mode 100644 index 00000000..5176e9b4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v1.json new file mode 100644 index 00000000..4a0f4aa1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v1.yaml new file mode 100644 index 00000000..c9e7eda6 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v2.json new file mode 100644 index 00000000..e9d59b9d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v2.yaml new file mode 100644 index 00000000..89699204 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical-uuid.json new file mode 100644 index 00000000..f0ccb928 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical-uuid.yaml new file mode 100644 index 00000000..7ce393a5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..44bb2aa7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..1feeaab2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/regression_error_field_in_record.json new file mode 100644 index 00000000..dd638c1b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/regression_error_field_in_record.yaml new file mode 100644 index 00000000..3578e507 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-read.json new file mode 100644 index 00000000..4f0d5526 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-read.yaml new file mode 100644 index 00000000..fe80ba0d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-write.json new file mode 100644 index 00000000..5532797b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-write.yaml new file mode 100644 index 00000000..a832e70d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location.json new file mode 100644 index 00000000..18357b60 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location.yaml new file mode 100644 index 00000000..11e2889d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/simple_record.json new file mode 100644 index 00000000..e03e2998 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/simple_record.yaml new file mode 100644 index 00000000..aed0e550 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/union_and_fixed_fields.json new file mode 100644 index 00000000..3abf3347 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.0", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/union_and_fixed_fields.yaml new file mode 100644 index 00000000..9be06c34 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.0/vnd.apache.avro/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.0 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/ApplicationEvent.json new file mode 100644 index 00000000..a43d0f6f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/DocumentInfo.json new file mode 100644 index 00000000..686ba97d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/MyResponse.json new file mode 100644 index 00000000..3e162495 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/SchemaBuilder.json new file mode 100644 index 00000000..6b83f55f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..7b6acade --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..c3c0346a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/TestUnionRecord.json new file mode 100644 index 00000000..20d1ea68 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/foo.Bar.json new file mode 100644 index 00000000..df5a1b7a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/full_record_v1.json new file mode 100644 index 00000000..316ca67d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/full_record_v2.json new file mode 100644 index 00000000..cec3ad41 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/logical-uuid.json new file mode 100644 index 00000000..f7d69f77 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..9e88a248 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/regression_error_field_in_record.json new file mode 100644 index 00000000..e9ac2d90 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/schema-location-read.json new file mode 100644 index 00000000..6fc34ed4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/schema-location-write.json new file mode 100644 index 00000000..a0fca74e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/schema-location.json new file mode 100644 index 00000000..3f9dcdf0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/simple_record.json new file mode 100644 index 00000000..6b13de4a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/union_and_fixed_fields.json new file mode 100644 index 00000000..d033ec6d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+json/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.1", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/ApplicationEvent.yaml new file mode 100644 index 00000000..e0ee2cda --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/DocumentInfo.yaml new file mode 100644 index 00000000..af2975c1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/MyResponse.yaml new file mode 100644 index 00000000..2ac28fce --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/SchemaBuilder.yaml new file mode 100644 index 00000000..631a0bd0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..f9624a13 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..d2623811 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/TestUnionRecord.yaml new file mode 100644 index 00000000..bc9d1f2b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/foo.Bar.yaml new file mode 100644 index 00000000..b198cf1c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/full_record_v1.yaml new file mode 100644 index 00000000..7ac87480 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/full_record_v2.yaml new file mode 100644 index 00000000..cd4c103f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/logical-uuid.yaml new file mode 100644 index 00000000..d7e5e136 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..885ff7ca --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/regression_error_field_in_record.yaml new file mode 100644 index 00000000..68f12374 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/schema-location-read.yaml new file mode 100644 index 00000000..bd75cda3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/schema-location-write.yaml new file mode 100644 index 00000000..a177941b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/schema-location.yaml new file mode 100644 index 00000000..b77aa3a2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/simple_record.yaml new file mode 100644 index 00000000..a9c031de --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/union_and_fixed_fields.yaml new file mode 100644 index 00000000..f3323395 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro+yaml/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.1 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/ApplicationEvent.json new file mode 100644 index 00000000..c100e124 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/ApplicationEvent.yaml new file mode 100644 index 00000000..32c75173 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/DocumentInfo.json new file mode 100644 index 00000000..3a454c65 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/DocumentInfo.yaml new file mode 100644 index 00000000..3af8ca73 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/MyResponse.json new file mode 100644 index 00000000..3292040d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/MyResponse.yaml new file mode 100644 index 00000000..98bb02b9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/SchemaBuilder.json new file mode 100644 index 00000000..79037029 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/SchemaBuilder.yaml new file mode 100644 index 00000000..19cfae6e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..6e6ebc8d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..37bf7ae1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..7dd6053f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..ed45b0f7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestUnionRecord.json new file mode 100644 index 00000000..79f81e0a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestUnionRecord.yaml new file mode 100644 index 00000000..d0e03b67 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/foo.Bar.json new file mode 100644 index 00000000..4832c791 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/foo.Bar.yaml new file mode 100644 index 00000000..0908d65a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v1.json new file mode 100644 index 00000000..ca86f831 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v1.yaml new file mode 100644 index 00000000..ae4221c7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v2.json new file mode 100644 index 00000000..e15c6e07 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v2.yaml new file mode 100644 index 00000000..675ade4b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical-uuid.json new file mode 100644 index 00000000..ac8c6370 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical-uuid.yaml new file mode 100644 index 00000000..1c88b8a1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..0bb35b65 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..3ccbb235 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/regression_error_field_in_record.json new file mode 100644 index 00000000..bbcbf6d5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/regression_error_field_in_record.yaml new file mode 100644 index 00000000..2c73986d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-read.json new file mode 100644 index 00000000..e3c376b6 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-read.yaml new file mode 100644 index 00000000..d14f3d11 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-write.json new file mode 100644 index 00000000..f3751913 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-write.yaml new file mode 100644 index 00000000..92c1d404 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location.json new file mode 100644 index 00000000..ffb30a44 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location.yaml new file mode 100644 index 00000000..020b315c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/simple_record.json new file mode 100644 index 00000000..440925b1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/simple_record.yaml new file mode 100644 index 00000000..0ed04ed7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/union_and_fixed_fields.json new file mode 100644 index 00000000..8fba05a7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.1", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/union_and_fixed_fields.yaml new file mode 100644 index 00000000..13fd2fd9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.1/vnd.apache.avro/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.1 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/ApplicationEvent.json new file mode 100644 index 00000000..1319e4df --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/DocumentInfo.json new file mode 100644 index 00000000..7e36a744 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/MyResponse.json new file mode 100644 index 00000000..9c21f64e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/SchemaBuilder.json new file mode 100644 index 00000000..93cbcb03 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..3e1d4926 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..04066c13 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/TestUnionRecord.json new file mode 100644 index 00000000..9a394d7c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/foo.Bar.json new file mode 100644 index 00000000..b6ec45e5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/full_record_v1.json new file mode 100644 index 00000000..1bcb188b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/full_record_v2.json new file mode 100644 index 00000000..acbd8d4c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/logical-uuid.json new file mode 100644 index 00000000..8ab1d27e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..83c16b37 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/regression_error_field_in_record.json new file mode 100644 index 00000000..854230e8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/schema-location-read.json new file mode 100644 index 00000000..f89dfc24 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/schema-location-write.json new file mode 100644 index 00000000..8d972805 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/schema-location.json new file mode 100644 index 00000000..6d2aef04 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/simple_record.json new file mode 100644 index 00000000..3866080d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/union_and_fixed_fields.json new file mode 100644 index 00000000..a27541c1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+json/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.10.2", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/ApplicationEvent.yaml new file mode 100644 index 00000000..0e3c8dc4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/DocumentInfo.yaml new file mode 100644 index 00000000..0921e297 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/MyResponse.yaml new file mode 100644 index 00000000..5e5fc560 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/SchemaBuilder.yaml new file mode 100644 index 00000000..f35068e9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..48ce722a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..5ffc7693 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/TestUnionRecord.yaml new file mode 100644 index 00000000..69b1dae0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/foo.Bar.yaml new file mode 100644 index 00000000..3b1b76b8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/full_record_v1.yaml new file mode 100644 index 00000000..6d98a94e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/full_record_v2.yaml new file mode 100644 index 00000000..d9501a4e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/logical-uuid.yaml new file mode 100644 index 00000000..9ba29202 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..7f07d913 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/regression_error_field_in_record.yaml new file mode 100644 index 00000000..8fd2223c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/schema-location-read.yaml new file mode 100644 index 00000000..5bd4f789 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/schema-location-write.yaml new file mode 100644 index 00000000..5afa1faf --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/schema-location.yaml new file mode 100644 index 00000000..6233a7ef --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/simple_record.yaml new file mode 100644 index 00000000..4e71d612 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/union_and_fixed_fields.yaml new file mode 100644 index 00000000..6060855d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro+yaml/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.10.2 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/ApplicationEvent.json new file mode 100644 index 00000000..17a3c1ef --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/ApplicationEvent.yaml new file mode 100644 index 00000000..5a7c37e2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/DocumentInfo.json new file mode 100644 index 00000000..726e9ffe --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/DocumentInfo.yaml new file mode 100644 index 00000000..8a752139 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/MyResponse.json new file mode 100644 index 00000000..dfe8240f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/MyResponse.yaml new file mode 100644 index 00000000..9029df24 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/SchemaBuilder.json new file mode 100644 index 00000000..06446dfc --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/SchemaBuilder.yaml new file mode 100644 index 00000000..2e5dafda --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..ca21c01b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..e07403e1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..1742ad71 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..379d44db --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestUnionRecord.json new file mode 100644 index 00000000..abeb59a7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestUnionRecord.yaml new file mode 100644 index 00000000..ec5acc73 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/foo.Bar.json new file mode 100644 index 00000000..3c73fb56 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/foo.Bar.yaml new file mode 100644 index 00000000..4c78ded2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v1.json new file mode 100644 index 00000000..ba4e8b7a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v1.yaml new file mode 100644 index 00000000..4c4fd999 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v2.json new file mode 100644 index 00000000..9988c4d6 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v2.yaml new file mode 100644 index 00000000..cca79f12 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical-uuid.json new file mode 100644 index 00000000..a92d39e7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical-uuid.yaml new file mode 100644 index 00000000..b8d493c2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..8961acbd --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..b3f02f95 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/regression_error_field_in_record.json new file mode 100644 index 00000000..1fbc7937 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/regression_error_field_in_record.yaml new file mode 100644 index 00000000..944d3a34 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-read.json new file mode 100644 index 00000000..da640be8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-read.yaml new file mode 100644 index 00000000..20947e15 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-write.json new file mode 100644 index 00000000..cea82de0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-write.yaml new file mode 100644 index 00000000..6cdda889 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location.json new file mode 100644 index 00000000..e75508b8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location.yaml new file mode 100644 index 00000000..3ae4ebfa --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/simple_record.json new file mode 100644 index 00000000..91bab326 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/simple_record.yaml new file mode 100644 index 00000000..7a31802f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/union_and_fixed_fields.json new file mode 100644 index 00000000..571e97b0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.10.2", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/union_and_fixed_fields.yaml new file mode 100644 index 00000000..fbe84270 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.10.2/vnd.apache.avro/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro;version=1.10.2 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/ApplicationEvent.json new file mode 100644 index 00000000..4a81ed64 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/DocumentInfo.json new file mode 100644 index 00000000..0a55f74f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/MyResponse.json new file mode 100644 index 00000000..29a06856 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/SchemaBuilder.json new file mode 100644 index 00000000..f4e5567b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..c7f2cf0d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..c9cf455b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/TestUnionRecord.json new file mode 100644 index 00000000..9404f855 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/foo.Bar.json new file mode 100644 index 00000000..ac9f87b3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/full_record_v1.json new file mode 100644 index 00000000..fd6df24f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/full_record_v2.json new file mode 100644 index 00000000..eb6551e8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/logical-uuid.json new file mode 100644 index 00000000..ee720169 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..ba2c8198 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/regression_error_field_in_record.json new file mode 100644 index 00000000..3dc0b006 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/schema-location-read.json new file mode 100644 index 00000000..7e1a424d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/schema-location-write.json new file mode 100644 index 00000000..11abfed4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/schema-location.json new file mode 100644 index 00000000..eba8c1f1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/simple_record.json new file mode 100644 index 00000000..2e3f27cb --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/union_and_fixed_fields.json new file mode 100644 index 00000000..93d43634 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+json/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.0", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/ApplicationEvent.yaml new file mode 100644 index 00000000..03236807 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/DocumentInfo.yaml new file mode 100644 index 00000000..22072983 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/MyResponse.yaml new file mode 100644 index 00000000..aff0e94f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/SchemaBuilder.yaml new file mode 100644 index 00000000..335d4876 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..296a4d25 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..e6cc3384 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/TestUnionRecord.yaml new file mode 100644 index 00000000..aeea4687 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/foo.Bar.yaml new file mode 100644 index 00000000..7a3db901 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/full_record_v1.yaml new file mode 100644 index 00000000..39a21559 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/full_record_v2.yaml new file mode 100644 index 00000000..542ec781 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/logical-uuid.yaml new file mode 100644 index 00000000..fef0e1e1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..5477bb8c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/regression_error_field_in_record.yaml new file mode 100644 index 00000000..bfb67852 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/schema-location-read.yaml new file mode 100644 index 00000000..4d681e41 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/schema-location-write.yaml new file mode 100644 index 00000000..37d7dd14 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/schema-location.yaml new file mode 100644 index 00000000..96eb6bdc --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/simple_record.yaml new file mode 100644 index 00000000..0a8bd77a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/union_and_fixed_fields.yaml new file mode 100644 index 00000000..6c9b12f9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro+yaml/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.0 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/ApplicationEvent.json new file mode 100644 index 00000000..fd627743 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/ApplicationEvent.yaml new file mode 100644 index 00000000..3a4eb834 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/DocumentInfo.json new file mode 100644 index 00000000..a624086d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/DocumentInfo.yaml new file mode 100644 index 00000000..08c3c214 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/MyResponse.json new file mode 100644 index 00000000..70eb69e9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/MyResponse.yaml new file mode 100644 index 00000000..0e556bec --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/SchemaBuilder.json new file mode 100644 index 00000000..7b40b630 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/SchemaBuilder.yaml new file mode 100644 index 00000000..5b28fa84 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..121798e1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..c70f7d5c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..9b9daa8f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..81344dee --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestUnionRecord.json new file mode 100644 index 00000000..eedd00a8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestUnionRecord.yaml new file mode 100644 index 00000000..f4e5cfe9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/foo.Bar.json new file mode 100644 index 00000000..941c2170 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/foo.Bar.yaml new file mode 100644 index 00000000..5682fce4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v1.json new file mode 100644 index 00000000..8ffa4eaa --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v1.yaml new file mode 100644 index 00000000..d4a745ff --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v2.json new file mode 100644 index 00000000..4203673b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v2.yaml new file mode 100644 index 00000000..4977af69 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical-uuid.json new file mode 100644 index 00000000..9f724db4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical-uuid.yaml new file mode 100644 index 00000000..12d128e4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..74394a76 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..4ecac9d4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/regression_error_field_in_record.json new file mode 100644 index 00000000..77f23d93 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/regression_error_field_in_record.yaml new file mode 100644 index 00000000..6d49f053 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-read.json new file mode 100644 index 00000000..2f80eca3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-read.yaml new file mode 100644 index 00000000..1ae5f1b8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-write.json new file mode 100644 index 00000000..d6eed846 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-write.yaml new file mode 100644 index 00000000..36fa0df4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location.json new file mode 100644 index 00000000..7ab01116 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location.yaml new file mode 100644 index 00000000..637d72a0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/simple_record.json new file mode 100644 index 00000000..4a72b951 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/simple_record.yaml new file mode 100644 index 00000000..a21a5bfa --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/union_and_fixed_fields.json new file mode 100644 index 00000000..be320339 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.0", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/union_and_fixed_fields.yaml new file mode 100644 index 00000000..2d193668 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.0/vnd.apache.avro/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.0 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/ApplicationEvent.json new file mode 100644 index 00000000..55bff5ba --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/DocumentInfo.json new file mode 100644 index 00000000..d23a981e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/MyResponse.json new file mode 100644 index 00000000..7cfc4a53 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/SchemaBuilder.json new file mode 100644 index 00000000..aa1c0d7a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..bd9586f7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..02f1d7d3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/TestUnionRecord.json new file mode 100644 index 00000000..3a855ad8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/foo.Bar.json new file mode 100644 index 00000000..e29d712a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/full_record_v1.json new file mode 100644 index 00000000..11d8b0e7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/full_record_v2.json new file mode 100644 index 00000000..bc2b9190 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/logical-uuid.json new file mode 100644 index 00000000..3f9ea489 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..2f8f8b61 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/regression_error_field_in_record.json new file mode 100644 index 00000000..be3156f3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/schema-location-read.json new file mode 100644 index 00000000..5a6d20cf --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/schema-location-write.json new file mode 100644 index 00000000..d0faa673 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/schema-location.json new file mode 100644 index 00000000..87e9490b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/simple_record.json new file mode 100644 index 00000000..8d499f33 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/union_and_fixed_fields.json new file mode 100644 index 00000000..340ec2f0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+json/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.11.1", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/ApplicationEvent.yaml new file mode 100644 index 00000000..02117872 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/DocumentInfo.yaml new file mode 100644 index 00000000..60da782a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/MyResponse.yaml new file mode 100644 index 00000000..a6debd32 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/SchemaBuilder.yaml new file mode 100644 index 00000000..b3798c31 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..9f30c293 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..046368b8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/TestUnionRecord.yaml new file mode 100644 index 00000000..cd0f2f72 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/foo.Bar.yaml new file mode 100644 index 00000000..1623583c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/full_record_v1.yaml new file mode 100644 index 00000000..70d981d0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/full_record_v2.yaml new file mode 100644 index 00000000..38e0d4e7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/logical-uuid.yaml new file mode 100644 index 00000000..7bdd6104 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..69d248c2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/regression_error_field_in_record.yaml new file mode 100644 index 00000000..e2f119ee --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/schema-location-read.yaml new file mode 100644 index 00000000..662329d0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/schema-location-write.yaml new file mode 100644 index 00000000..b63c824e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/schema-location.yaml new file mode 100644 index 00000000..74fc0005 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/simple_record.yaml new file mode 100644 index 00000000..bbc648fe --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/union_and_fixed_fields.yaml new file mode 100644 index 00000000..dda9e031 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro+yaml/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.11.1 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/ApplicationEvent.json new file mode 100644 index 00000000..4582d1ee --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/ApplicationEvent.yaml new file mode 100644 index 00000000..2695c5d5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/DocumentInfo.json new file mode 100644 index 00000000..a1641a25 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/DocumentInfo.yaml new file mode 100644 index 00000000..f3022e79 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/MyResponse.json new file mode 100644 index 00000000..2490666e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/MyResponse.yaml new file mode 100644 index 00000000..39599dd7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/SchemaBuilder.json new file mode 100644 index 00000000..3e35b8b5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/SchemaBuilder.yaml new file mode 100644 index 00000000..6b2c5376 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..237fc219 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..707aa347 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..3d386ba7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..00a65950 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestUnionRecord.json new file mode 100644 index 00000000..469c4e7b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestUnionRecord.yaml new file mode 100644 index 00000000..8b3aa2e6 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/foo.Bar.json new file mode 100644 index 00000000..2aaf4454 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/foo.Bar.yaml new file mode 100644 index 00000000..f9887c87 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v1.json new file mode 100644 index 00000000..4d37d307 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v1.yaml new file mode 100644 index 00000000..3e538d97 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v2.json new file mode 100644 index 00000000..d22becbc --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v2.yaml new file mode 100644 index 00000000..7c39855f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical-uuid.json new file mode 100644 index 00000000..43bc837c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical-uuid.yaml new file mode 100644 index 00000000..b2bdf139 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..231be206 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..02aea719 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/regression_error_field_in_record.json new file mode 100644 index 00000000..0d75cb11 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/regression_error_field_in_record.yaml new file mode 100644 index 00000000..a308695c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-read.json new file mode 100644 index 00000000..b40732d1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-read.yaml new file mode 100644 index 00000000..b4dc8cdb --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-write.json new file mode 100644 index 00000000..ca67d402 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-write.yaml new file mode 100644 index 00000000..cdcb8a74 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location.json new file mode 100644 index 00000000..372cae9b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location.yaml new file mode 100644 index 00000000..633329b2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/simple_record.json new file mode 100644 index 00000000..3b283b46 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/simple_record.yaml new file mode 100644 index 00000000..4243d0b6 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/union_and_fixed_fields.json new file mode 100644 index 00000000..b894dfa1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.11.1", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/union_and_fixed_fields.yaml new file mode 100644 index 00000000..bdfe223f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.11.1/vnd.apache.avro/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro;version=1.11.1 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/ApplicationEvent.json new file mode 100644 index 00000000..ca7eb337 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/DocumentInfo.json new file mode 100644 index 00000000..3e4b3783 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/MyResponse.json new file mode 100644 index 00000000..f3b67eb4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/SchemaBuilder.json new file mode 100644 index 00000000..ccf455e7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..33963477 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..c8720afe --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/TestUnionRecord.json new file mode 100644 index 00000000..d3d176c3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/foo.Bar.json new file mode 100644 index 00000000..413c4229 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/full_record_v1.json new file mode 100644 index 00000000..5ee7034b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/full_record_v2.json new file mode 100644 index 00000000..d650fb34 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/logical-uuid.json new file mode 100644 index 00000000..d60dda61 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..1272e5be --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/regression_error_field_in_record.json new file mode 100644 index 00000000..68ef9b6e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/schema-location-read.json new file mode 100644 index 00000000..93c04c5d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/schema-location-write.json new file mode 100644 index 00000000..6f61a708 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/schema-location.json new file mode 100644 index 00000000..b89d067f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/simple_record.json new file mode 100644 index 00000000..e86063a1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/union_and_fixed_fields.json new file mode 100644 index 00000000..1e09d8a1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+json/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/ApplicationEvent.yaml new file mode 100644 index 00000000..29fcfb59 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/DocumentInfo.yaml new file mode 100644 index 00000000..3101930d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/MyResponse.yaml new file mode 100644 index 00000000..86235632 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/SchemaBuilder.yaml new file mode 100644 index 00000000..b7df784d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..8a8a0554 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..e678106d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/TestUnionRecord.yaml new file mode 100644 index 00000000..c01c65e1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/foo.Bar.yaml new file mode 100644 index 00000000..10c9cdab --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/full_record_v1.yaml new file mode 100644 index 00000000..365f7011 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/full_record_v2.yaml new file mode 100644 index 00000000..912c0314 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/logical-uuid.yaml new file mode 100644 index 00000000..2d4948d9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..707a3db2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/regression_error_field_in_record.yaml new file mode 100644 index 00000000..4b5d6718 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/schema-location-read.yaml new file mode 100644 index 00000000..dfa3f931 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/schema-location-write.yaml new file mode 100644 index 00000000..7945311c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/schema-location.yaml new file mode 100644 index 00000000..cc483a59 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/simple_record.yaml new file mode 100644 index 00000000..3eee6ec3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/union_and_fixed_fields.yaml new file mode 100644 index 00000000..e3d29a47 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro+yaml/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.0 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/ApplicationEvent.json new file mode 100644 index 00000000..8224d884 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/ApplicationEvent.yaml new file mode 100644 index 00000000..45abf7a1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/DocumentInfo.json new file mode 100644 index 00000000..72ad6517 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/DocumentInfo.yaml new file mode 100644 index 00000000..8bbb8eff --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/MyResponse.json new file mode 100644 index 00000000..d4cdd5e3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/MyResponse.yaml new file mode 100644 index 00000000..10b51144 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/SchemaBuilder.json new file mode 100644 index 00000000..2bdc1bd4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/SchemaBuilder.yaml new file mode 100644 index 00000000..17a3ff05 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..013bf7a5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..857e843e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..8b71297d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..4d4f5a1b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestUnionRecord.json new file mode 100644 index 00000000..6abb1ffa --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestUnionRecord.yaml new file mode 100644 index 00000000..7eed0342 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/foo.Bar.json new file mode 100644 index 00000000..24e79c0a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/foo.Bar.yaml new file mode 100644 index 00000000..efc90ef3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v1.json new file mode 100644 index 00000000..e49d28b0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v1.yaml new file mode 100644 index 00000000..a52b0350 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v2.json new file mode 100644 index 00000000..068c40ae --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v2.yaml new file mode 100644 index 00000000..364c543d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical-uuid.json new file mode 100644 index 00000000..ddab914b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical-uuid.yaml new file mode 100644 index 00000000..0104cfe9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..6c9b2721 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..8ba4b781 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/regression_error_field_in_record.json new file mode 100644 index 00000000..56d50f09 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/regression_error_field_in_record.yaml new file mode 100644 index 00000000..862317cb --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-read.json new file mode 100644 index 00000000..1b46e9de --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-read.yaml new file mode 100644 index 00000000..ad2dde93 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-write.json new file mode 100644 index 00000000..fd4bb290 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-write.yaml new file mode 100644 index 00000000..4a5a12f9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location.json new file mode 100644 index 00000000..2d5cd418 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location.yaml new file mode 100644 index 00000000..72e18a97 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/simple_record.json new file mode 100644 index 00000000..f6846a98 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/simple_record.yaml new file mode 100644 index 00000000..ff6d7c33 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/union_and_fixed_fields.json new file mode 100644 index 00000000..8ba42070 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.0", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/union_and_fixed_fields.yaml new file mode 100644 index 00000000..f5d78645 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.0/vnd.apache.avro/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.0 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/ApplicationEvent.json new file mode 100644 index 00000000..d81164c7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/DocumentInfo.json new file mode 100644 index 00000000..16f8d434 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/MyResponse.json new file mode 100644 index 00000000..b1ae31fe --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/SchemaBuilder.json new file mode 100644 index 00000000..e301b4a9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..d7e6e9fa --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..2a2243bd --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/TestUnionRecord.json new file mode 100644 index 00000000..770e777f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/foo.Bar.json new file mode 100644 index 00000000..37d812d5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/full_record_v1.json new file mode 100644 index 00000000..60c9d726 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/full_record_v2.json new file mode 100644 index 00000000..f059abf6 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/logical-uuid.json new file mode 100644 index 00000000..4d3c337e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..d6508200 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/regression_error_field_in_record.json new file mode 100644 index 00000000..ea1fce48 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/schema-location-read.json new file mode 100644 index 00000000..2cc33aac --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/schema-location-write.json new file mode 100644 index 00000000..78ae67d0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/schema-location.json new file mode 100644 index 00000000..ae51a947 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/simple_record.json new file mode 100644 index 00000000..8d74cf3b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/union_and_fixed_fields.json new file mode 100644 index 00000000..3f086c2e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+json/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.1", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/ApplicationEvent.yaml new file mode 100644 index 00000000..c5e81408 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/DocumentInfo.yaml new file mode 100644 index 00000000..a6b3dda7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/MyResponse.yaml new file mode 100644 index 00000000..2e0eb07f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/SchemaBuilder.yaml new file mode 100644 index 00000000..100c5f5a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..a7e67091 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..2b0f711f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/TestUnionRecord.yaml new file mode 100644 index 00000000..50aaef25 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/foo.Bar.yaml new file mode 100644 index 00000000..c1bd4991 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/full_record_v1.yaml new file mode 100644 index 00000000..82cd6c76 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/full_record_v2.yaml new file mode 100644 index 00000000..1510242a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/logical-uuid.yaml new file mode 100644 index 00000000..dd0231cf --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..1fa8f74d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/regression_error_field_in_record.yaml new file mode 100644 index 00000000..d6debd3b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/schema-location-read.yaml new file mode 100644 index 00000000..42132381 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/schema-location-write.yaml new file mode 100644 index 00000000..e2066186 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/schema-location.yaml new file mode 100644 index 00000000..f36ef43d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/simple_record.yaml new file mode 100644 index 00000000..5ed1c50d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/union_and_fixed_fields.yaml new file mode 100644 index 00000000..7faabc25 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro+yaml/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.1 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/ApplicationEvent.json new file mode 100644 index 00000000..36057ba6 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/ApplicationEvent.yaml new file mode 100644 index 00000000..50ac9c03 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/DocumentInfo.json new file mode 100644 index 00000000..bf19adc1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/DocumentInfo.yaml new file mode 100644 index 00000000..268d0a69 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/MyResponse.json new file mode 100644 index 00000000..5ff1d878 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/MyResponse.yaml new file mode 100644 index 00000000..eb9a29f1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/SchemaBuilder.json new file mode 100644 index 00000000..f84503c4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/SchemaBuilder.yaml new file mode 100644 index 00000000..43e23b54 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..ece3bcfd --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..347775be --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..f9227b36 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..172a4952 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestUnionRecord.json new file mode 100644 index 00000000..e3031ee8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestUnionRecord.yaml new file mode 100644 index 00000000..d4ed2e26 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/foo.Bar.json new file mode 100644 index 00000000..71c14f08 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/foo.Bar.yaml new file mode 100644 index 00000000..2f5f8f96 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v1.json new file mode 100644 index 00000000..accf9aee --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v1.yaml new file mode 100644 index 00000000..589f89ba --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v2.json new file mode 100644 index 00000000..2135cae5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v2.yaml new file mode 100644 index 00000000..768af978 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical-uuid.json new file mode 100644 index 00000000..773ce745 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical-uuid.yaml new file mode 100644 index 00000000..1bdec03e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..2fc46f35 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..607ca47c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/regression_error_field_in_record.json new file mode 100644 index 00000000..b1f81ddb --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/regression_error_field_in_record.yaml new file mode 100644 index 00000000..e7eb9310 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-read.json new file mode 100644 index 00000000..772f0a19 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-read.yaml new file mode 100644 index 00000000..52fca4ba --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-write.json new file mode 100644 index 00000000..40fd8935 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-write.yaml new file mode 100644 index 00000000..11c51a43 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location.json new file mode 100644 index 00000000..cdbec3a1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location.yaml new file mode 100644 index 00000000..7306d724 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/simple_record.json new file mode 100644 index 00000000..723a34c5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/simple_record.yaml new file mode 100644 index 00000000..c28914a4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/union_and_fixed_fields.json new file mode 100644 index 00000000..b3fb1b0a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.1", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/union_and_fixed_fields.yaml new file mode 100644 index 00000000..7453626a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.1/vnd.apache.avro/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.1 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/ApplicationEvent.json new file mode 100644 index 00000000..eb7106e2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/DocumentInfo.json new file mode 100644 index 00000000..3f5a4d3c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/MyResponse.json new file mode 100644 index 00000000..467d03d5 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/SchemaBuilder.json new file mode 100644 index 00000000..834f9194 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..7f817591 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..cf881ddb --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/TestUnionRecord.json new file mode 100644 index 00000000..8390794b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/foo.Bar.json new file mode 100644 index 00000000..e6088df3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/full_record_v1.json new file mode 100644 index 00000000..ee9f6726 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/full_record_v2.json new file mode 100644 index 00000000..8dda3a06 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/logical-uuid.json new file mode 100644 index 00000000..41d0631d --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..5c10f088 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/regression_error_field_in_record.json new file mode 100644 index 00000000..050e8b88 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/schema-location-read.json new file mode 100644 index 00000000..17d378fd --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/schema-location-write.json new file mode 100644 index 00000000..d08d6c6c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/schema-location.json new file mode 100644 index 00000000..f6f04913 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/simple_record.json new file mode 100644 index 00000000..780d81ad --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/union_and_fixed_fields.json new file mode 100644 index 00000000..accadc8c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+json/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.2", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/ApplicationEvent.yaml new file mode 100644 index 00000000..996a6853 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/DocumentInfo.yaml new file mode 100644 index 00000000..ead9ad4a --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/MyResponse.yaml new file mode 100644 index 00000000..8d29f1ba --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/SchemaBuilder.yaml new file mode 100644 index 00000000..7e0ad977 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..3747400f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..821c88ed --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/TestUnionRecord.yaml new file mode 100644 index 00000000..d25eb8eb --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/foo.Bar.yaml new file mode 100644 index 00000000..6f0796b0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/full_record_v1.yaml new file mode 100644 index 00000000..1cd2b113 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/full_record_v2.yaml new file mode 100644 index 00000000..c14246b6 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/logical-uuid.yaml new file mode 100644 index 00000000..da694e7b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..56e538d7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/regression_error_field_in_record.yaml new file mode 100644 index 00000000..e3b30f57 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/schema-location-read.yaml new file mode 100644 index 00000000..ff424075 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/schema-location-write.yaml new file mode 100644 index 00000000..de3c4f4e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/schema-location.yaml new file mode 100644 index 00000000..5051b798 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/simple_record.yaml new file mode 100644 index 00000000..2901b30f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/union_and_fixed_fields.yaml new file mode 100644 index 00000000..71a89248 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro+yaml/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro+yaml;version=1.9.2 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/ApplicationEvent.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/ApplicationEvent.json new file mode 100644 index 00000000..c5b6168f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/ApplicationEvent.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "ApplicationEvent", + "fields": [ + { + "name": "applicationId", + "type": "string", + "doc": "Application ID" + }, + { + "name": "status", + "type": "string", + "doc": "Application Status" + }, + { + "name": "documents", + "type": [ + "null", + { + "type": "array", + "items": "model.DocumentInfo" + } + ], + "doc": "", + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/ApplicationEvent.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/ApplicationEvent.yaml new file mode 100644 index 00000000..c249f3e3 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/ApplicationEvent.yaml @@ -0,0 +1,20 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + namespace: model + type: record + doc: '' + name: ApplicationEvent + fields: + - name: applicationId + type: string + doc: Application ID + - name: status + type: string + doc: Application Status + - name: documents + type: + - 'null' + - type: array + items: model.DocumentInfo + doc: '' + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/DocumentInfo.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/DocumentInfo.json new file mode 100644 index 00000000..b18bf5c0 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/DocumentInfo.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "DocumentInfo", + "fields": [ + { + "name": "documentId", + "type": "string", + "doc": "Document ID" + }, + { + "name": "filePath", + "type": "string", + "doc": "Document Path" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/DocumentInfo.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/DocumentInfo.yaml new file mode 100644 index 00000000..e8c318f2 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/DocumentInfo.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + namespace: model + type: record + doc: '' + name: DocumentInfo + fields: + - name: documentId + type: string + doc: Document ID + - name: filePath + type: string + doc: Document Path diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/MyResponse.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/MyResponse.json new file mode 100644 index 00000000..85b6e9e7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/MyResponse.json @@ -0,0 +1,16 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "namespace": "model", + "type": "record", + "doc": "", + "name": "MyResponse", + "fields": [ + { + "name": "isSuccessful", + "type": "boolean", + "doc": "Indicator for successful or unsuccessful call" + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/MyResponse.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/MyResponse.yaml new file mode 100644 index 00000000..3639dab9 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/MyResponse.yaml @@ -0,0 +1,10 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + namespace: model + type: record + doc: '' + name: MyResponse + fields: + - name: isSuccessful + type: boolean + doc: Indicator for successful or unsuccessful call diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/SchemaBuilder.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/SchemaBuilder.json new file mode 100644 index 00000000..5ce77610 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/SchemaBuilder.json @@ -0,0 +1,287 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "type" : "record", + "name" : "recordAll", + "fields" : [ { + "name" : "requiredBoolean", + "type" : "boolean" + }, { + "name" : "requiredBooleanWithDefault", + "type" : "boolean", + "default" : true + }, { + "name" : "optionalBoolean", + "type" : [ "null", "boolean" ], + "default" : null + }, { + "name" : "optionalBooleanWithDefault", + "type" : [ "boolean", "null" ], + "default" : true + }, { + "name" : "requiredInt", + "type" : "int" + }, { + "name" : "optionalInt", + "type" : [ "null", "int" ], + "default" : null + }, { + "name" : "optionalIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "requiredLong", + "type" : "long" + }, { + "name" : "optionalLong", + "type" : [ "null", "long" ], + "default" : null + }, { + "name" : "optionalLongWithDefault", + "type" : [ "long", "null" ], + "default" : 1 + }, { + "name" : "requiredFloat", + "type" : "float" + }, { + "name" : "optionalFloat", + "type" : [ "null", "float" ], + "default" : null + }, { + "name" : "optionalFloatWithDefault", + "type" : [ "float", "null" ], + "default" : 1.0 + }, { + "name" : "requiredDouble", + "type" : "double" + }, { + "name" : "optionalDouble", + "type" : [ "null", "double" ], + "default" : null + }, { + "name" : "optionalDoubleWithDefault", + "type" : [ "double", "null" ], + "default" : 1.0 + }, { + "name" : "requiredBytes", + "type" : "bytes" + }, { + "name" : "optionalBytes", + "type" : [ "null", "bytes" ], + "default" : null + }, { + "name" : "optionalBytesWithDefault", + "type" : [ "bytes", "null" ], + "default" : "A" + }, { + "name" : "requiredString", + "type" : "string" + }, { + "name" : "optionalString", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "optionalStringWithDefault", + "type" : [ "string", "null" ], + "default" : "a" + }, { + "name" : "requiredRecord", + "type" : { + "type" : "record", + "name" : "nestedRequiredRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } + }, { + "name" : "optionalRecord", + "type" : [ "null", { + "type" : "record", + "name" : "nestedOptionalRecord", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + } ], + "default" : null + }, { + "name" : "optionalRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedOptionalRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "null" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "requiredEnum", + "type" : { + "type" : "enum", + "name" : "requiredEnum", + "symbols" : [ "a", "b" ] + } + }, { + "name" : "optionalEnum", + "type" : [ "null", { + "type" : "enum", + "name" : "optionalEnum", + "symbols" : [ "a", "b" ] + } ], + "default" : null + }, { + "name" : "optionalEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "optionalEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "null" ], + "default" : "b" + }, { + "name" : "requiredArray", + "type" : { + "type" : "array", + "items" : "string" + } + }, { + "name" : "optionalArray", + "type" : [ "null", { + "type" : "array", + "items" : "string" + } ], + "default" : null + }, { + "name" : "optionalArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "null" ], + "default" : [ "a" ] + }, { + "name" : "requiredMap", + "type" : { + "type" : "map", + "values" : "string" + } + }, { + "name" : "optionalMap", + "type" : [ "null", { + "type" : "map", + "values" : "string" + } ], + "default" : null + }, { + "name" : "optionalMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "null" ], + "default" : { + "a" : "b" + } + }, { + "name" : "requiredFixed", + "type" : { + "type" : "fixed", + "name" : "requiredFixed", + "size" : 1 + } + }, { + "name" : "optionalFixed", + "type" : [ "null", { + "type" : "fixed", + "name" : "optionalFixed", + "size" : 1 + } ], + "default" : null + }, { + "name" : "optionalFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "optionalFixedWithDefault", + "size" : 1 + }, "null" ], + "default" : "A" + }, { + "name" : "unionType", + "type" : [ "long", "null" ] + }, { + "name" : "unionBooleanWithDefault", + "type" : [ "boolean", "int" ], + "default" : true + }, { + "name" : "unionIntWithDefault", + "type" : [ "int", "null" ], + "default" : 1 + }, { + "name" : "unionLongWithDefault", + "type" : [ "long", "int" ], + "default" : 1 + }, { + "name" : "unionFloatWithDefault", + "type" : [ "float", "int" ], + "default" : 1.0 + }, { + "name" : "unionDoubleWithDefault", + "type" : [ "double", "int" ], + "default" : 1.0 + }, { + "name" : "unionBytesWithDefault", + "type" : [ "bytes", "int" ], + "default" : "A" + }, { + "name" : "unionStringWithDefault", + "type" : [ "string", "int" ], + "default" : "a" + }, { + "name" : "unionRecordWithDefault", + "type" : [ { + "type" : "record", + "name" : "nestedUnionRecordWithDefault", + "fields" : [ { + "name" : "nestedRequiredBoolean", + "type" : "boolean" + } ] + }, "int" ], + "default" : { + "nestedRequiredBoolean" : true + } + }, { + "name" : "unionEnumWithDefault", + "type" : [ { + "type" : "enum", + "name" : "nestedUnionEnumWithDefault", + "symbols" : [ "a", "b" ] + }, "int" ], + "default" : "b" + }, { + "name" : "unionArrayWithDefault", + "type" : [ { + "type" : "array", + "items" : "string" + }, "int" ], + "default" : [ "a" ] + }, { + "name" : "unionMapWithDefault", + "type" : [ { + "type" : "map", + "values" : "string" + }, "int" ], + "default" : { + "a" : "b" + } + }, { + "name" : "unionFixedWithDefault", + "type" : [ { + "type" : "fixed", + "name" : "nestedUnionFixedWithDefault", + "size" : 1 + }, "int" ], + "default" : "A" + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/SchemaBuilder.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/SchemaBuilder.yaml new file mode 100644 index 00000000..4a9273f4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/SchemaBuilder.yaml @@ -0,0 +1,275 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + type: record + name: recordAll + fields: + - name: requiredBoolean + type: boolean + - name: requiredBooleanWithDefault + type: boolean + default: true + - name: optionalBoolean + type: + - 'null' + - boolean + default: null + - name: optionalBooleanWithDefault + type: + - boolean + - 'null' + default: true + - name: requiredInt + type: int + - name: optionalInt + type: + - 'null' + - int + default: null + - name: optionalIntWithDefault + type: + - int + - 'null' + default: 1 + - name: requiredLong + type: long + - name: optionalLong + type: + - 'null' + - long + default: null + - name: optionalLongWithDefault + type: + - long + - 'null' + default: 1 + - name: requiredFloat + type: float + - name: optionalFloat + type: + - 'null' + - float + default: null + - name: optionalFloatWithDefault + type: + - float + - 'null' + default: 1.0 + - name: requiredDouble + type: double + - name: optionalDouble + type: + - 'null' + - double + default: null + - name: optionalDoubleWithDefault + type: + - double + - 'null' + default: 1.0 + - name: requiredBytes + type: bytes + - name: optionalBytes + type: + - 'null' + - bytes + default: null + - name: optionalBytesWithDefault + type: + - bytes + - 'null' + default: A + - name: requiredString + type: string + - name: optionalString + type: + - 'null' + - string + default: null + - name: optionalStringWithDefault + type: + - string + - 'null' + default: a + - name: requiredRecord + type: + type: record + name: nestedRequiredRecord + fields: + - name: nestedRequiredBoolean + type: boolean + - name: optionalRecord + type: + - 'null' + - type: record + name: nestedOptionalRecord + fields: + - name: nestedRequiredBoolean + type: boolean + default: null + - name: optionalRecordWithDefault + type: + - type: record + name: nestedOptionalRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - 'null' + default: + nestedRequiredBoolean: true + - name: requiredEnum + type: + type: enum + name: requiredEnum + symbols: + - a + - b + - name: optionalEnum + type: + - 'null' + - type: enum + name: optionalEnum + symbols: + - a + - b + default: null + - name: optionalEnumWithDefault + type: + - type: enum + name: optionalEnumWithDefault + symbols: + - a + - b + - 'null' + default: b + - name: requiredArray + type: + type: array + items: string + - name: optionalArray + type: + - 'null' + - type: array + items: string + default: null + - name: optionalArrayWithDefault + type: + - type: array + items: string + - 'null' + default: + - a + - name: requiredMap + type: + type: map + values: string + - name: optionalMap + type: + - 'null' + - type: map + values: string + default: null + - name: optionalMapWithDefault + type: + - type: map + values: string + - 'null' + default: + a: b + - name: requiredFixed + type: + type: fixed + name: requiredFixed + size: 1 + - name: optionalFixed + type: + - 'null' + - type: fixed + name: optionalFixed + size: 1 + default: null + - name: optionalFixedWithDefault + type: + - type: fixed + name: optionalFixedWithDefault + size: 1 + - 'null' + default: A + - name: unionType + type: + - long + - 'null' + - name: unionBooleanWithDefault + type: + - boolean + - int + default: true + - name: unionIntWithDefault + type: + - int + - 'null' + default: 1 + - name: unionLongWithDefault + type: + - long + - int + default: 1 + - name: unionFloatWithDefault + type: + - float + - int + default: 1.0 + - name: unionDoubleWithDefault + type: + - double + - int + default: 1.0 + - name: unionBytesWithDefault + type: + - bytes + - int + default: A + - name: unionStringWithDefault + type: + - string + - int + default: a + - name: unionRecordWithDefault + type: + - type: record + name: nestedUnionRecordWithDefault + fields: + - name: nestedRequiredBoolean + type: boolean + - int + default: + nestedRequiredBoolean: true + - name: unionEnumWithDefault + type: + - type: enum + name: nestedUnionEnumWithDefault + symbols: + - a + - b + - int + default: b + - name: unionArrayWithDefault + type: + - type: array + items: string + - int + default: + - a + - name: unionMapWithDefault + type: + - type: map + values: string + - int + default: + a: b + - name: unionFixedWithDefault + type: + - type: fixed + name: nestedUnionFixedWithDefault + size: 1 + - int + default: A diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithLogicalTypes.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithLogicalTypes.json new file mode 100644 index 00000000..77209ce1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithLogicalTypes.json @@ -0,0 +1,54 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "type" : "record", + "name" : "TestRecordWithLogicalTypes", + "doc" : "Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see TestSpecificLogicalTypes", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "d", + "type" : { + "type" : "int", + "logicalType" : "date" + } + }, { + "name" : "t", + "type" : { + "type" : "int", + "logicalType" : "time-millis" + } + }, { + "name" : "ts", + "type" : { + "type" : "long", + "logicalType" : "timestamp-millis" + } + }, { + "name" : "bd", + "type" : { + "type" : "bytes", + "logicalType" : "big-decimal" + } + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithLogicalTypes.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithLogicalTypes.yaml new file mode 100644 index 00000000..c4773a45 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithLogicalTypes.yaml @@ -0,0 +1,40 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + type: record + name: TestRecordWithLogicalTypes + doc: >- + Schema for TestRecordWithLogicalTypes and TestRecordWithoutLogicalTypes, see + TestSpecificLogicalTypes + namespace: org.apache.avro.specific + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: d + type: + type: int + logicalType: date + - name: t + type: + type: int + logicalType: time-millis + - name: ts + type: + type: long + logicalType: timestamp-millis + - name: bd + type: + type: bytes + logicalType: big-decimal diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithMapsAndArrays.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithMapsAndArrays.json new file mode 100644 index 00000000..9f2fb2af --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithMapsAndArrays.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "type": "record", + "name": "TestRecordWithMapsAndArrays", + "namespace": "org.apache.avro.specific", + "fields": [ + { + "name": "arr", + "type": { + "type": "array", + "items": "string", + "default": [] + } + }, + { + "name": "map", + "type": { + "type": "map", + "values": "long", + "default": {} + } + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml new file mode 100644 index 00000000..aca3814c --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestRecordWithMapsAndArrays.yaml @@ -0,0 +1,16 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + type: record + name: TestRecordWithMapsAndArrays + namespace: org.apache.avro.specific + fields: + - name: arr + type: + type: array + items: string + default: [] + - name: map + type: + type: map + values: long + default: {} diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestUnionRecord.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestUnionRecord.json new file mode 100644 index 00000000..ab88efd1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestUnionRecord.json @@ -0,0 +1,26 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": [ + "null", + { + "namespace": "org.apache.avro.specific", + "type": "record", + "name": "TestUnionRecord", + "fields": [ + { + "name": "amount", + "type": [ + "null", + { + "type": "bytes", + "logicalType": "decimal", + "precision": 31, + "scale": 8 + } + ], + "default": null + } + ] + } + ] +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestUnionRecord.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestUnionRecord.yaml new file mode 100644 index 00000000..a0ff23ec --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/TestUnionRecord.yaml @@ -0,0 +1,15 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + - 'null' + - namespace: org.apache.avro.specific + type: record + name: TestUnionRecord + fields: + - name: amount + type: + - 'null' + - type: bytes + logicalType: decimal + precision: 31 + scale: 8 + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/foo.Bar.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/foo.Bar.json new file mode 100644 index 00000000..db4af2d8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/foo.Bar.json @@ -0,0 +1,24 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "fields" : [ + { + "name" : "title", + "type" : "string" + }, + { + "name" : "created_at", + "type" : [ + "null", + { + "logicalType" : "timestamp-millis", + "type" : "long" + } + ] + } + ], + "name" : "Bar", + "namespace" : "foo", + "type" : "record" + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/foo.Bar.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/foo.Bar.yaml new file mode 100644 index 00000000..6d02b0da --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/foo.Bar.yaml @@ -0,0 +1,13 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + fields: + - name: title + type: string + - name: created_at + type: + - 'null' + - logicalType: timestamp-millis + type: long + name: Bar + namespace: foo + type: record diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v1.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v1.json new file mode 100644 index 00000000..d47bc55b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v1.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "type" : "record", + "name" : "FullRecordV1", + "doc" : "Test schema changes: this is the 'old' schema the SpecificRecord expects to see", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "i64", + "type" : "long" + }, { + "name" : "f32", + "type" : "float" + }, { + "name" : "f64", + "type" : "double" + }, { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name" : "h", + "type" : [ "null", "string" ] + } ] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v1.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v1.yaml new file mode 100644 index 00000000..02de22b6 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v1.yaml @@ -0,0 +1,28 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + type: record + name: FullRecordV1 + doc: >- + Test schema changes: this is the 'old' schema the SpecificRecord expects to + see + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i32 + type: int + - name: i64 + type: long + - name: f32 + type: float + - name: f64 + type: double + - name: s + type: + - 'null' + - string + default: null + - name: h + type: + - 'null' + - string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v2.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v2.json new file mode 100644 index 00000000..b41231f7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v2.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "type" : "record", + "name" : "FullRecordV2", + "doc" : "Test schema changes: this is the 'new' schema actually used to write data", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "b", + "type" : "boolean" + }, { + "name" : "i64", + "type" : "int" + }, { + "name" : "i32", + "type" : "int" + }, { + "name" : "f64", + "type" : "long" + }, { + "name" : "f32", + "type" : [ "float", "null" ] + }, { + "name" : "newfield", + "type" : "string" + }, { + "name" : "h", + "type" : "bytes" + }, + { "name" : "myMap", "type" : { "type" : "map", "values" : "string" } }] + } + +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v2.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v2.yaml new file mode 100644 index 00000000..8d2b05d6 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/full_record_v2.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + type: record + name: FullRecordV2 + doc: 'Test schema changes: this is the ''new'' schema actually used to write data' + namespace: org.apache.avro.specific.test + fields: + - name: b + type: boolean + - name: i64 + type: int + - name: i32 + type: int + - name: f64 + type: long + - name: f32 + type: + - float + - 'null' + - name: newfield + type: string + - name: h + type: bytes + - name: myMap + type: + type: map + values: string diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical-uuid.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical-uuid.json new file mode 100644 index 00000000..43b066bc --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical-uuid.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "guid", + "type": { "type": "string", "logicalType": "uuid" } + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical-uuid.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical-uuid.yaml new file mode 100644 index 00000000..f11e7f13 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical-uuid.yaml @@ -0,0 +1,21 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: guid + type: + type: string + logicalType: uuid + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical_types_with_multiple_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical_types_with_multiple_fields.json new file mode 100644 index 00000000..aa26b45f --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical_types_with_multiple_fields.json @@ -0,0 +1,33 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "namespace": "schema.common", + "type": "record", + "name": "Action", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "uuid", + "type": "string" + }, + { + "name": "time", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + } + }, + { + "name": "requestId", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical_types_with_multiple_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical_types_with_multiple_fields.yaml new file mode 100644 index 00000000..f7d355c4 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/logical_types_with_multiple_fields.yaml @@ -0,0 +1,19 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + namespace: schema.common + type: record + name: Action + fields: + - name: name + type: string + - name: uuid + type: string + - name: time + type: + type: long + logicalType: timestamp-millis + - name: requestId + type: + - 'null' + - string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/regression_error_field_in_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/regression_error_field_in_record.json new file mode 100644 index 00000000..2009d089 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/regression_error_field_in_record.json @@ -0,0 +1,25 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "type" : "record", + "name" : "RecordWithErrorField", + "doc" : "With custom coders in Avro 1.9, previously successful records with error fields now fail to compile.", + "namespace" : "org.apache.avro.specific.test", + "fields" : [ { + "name" : "s", + "type" : [ "null", "string" ], + "default" : null + }, { + "name": "e", + "type": [ "null", { + "type" : "error", + "name" : "TestError", + "fields" : [ { + "name" : "message", + "type" : "string" + } ] + } ], + "default": null + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/regression_error_field_in_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/regression_error_field_in_record.yaml new file mode 100644 index 00000000..c5e4a5b1 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/regression_error_field_in_record.yaml @@ -0,0 +1,23 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + type: record + name: RecordWithErrorField + doc: >- + With custom coders in Avro 1.9, previously successful records with error + fields now fail to compile. + namespace: org.apache.avro.specific.test + fields: + - name: s + type: + - 'null' + - string + default: null + - name: e + type: + - 'null' + - type: error + name: TestError + fields: + - name: message + type: string + default: null diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-read.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-read.json new file mode 100644 index 00000000..5f9720f8 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-read.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long_r2", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-read.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-read.yaml new file mode 100644 index 00000000..9a86ed73 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-read.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long_r2 + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-write.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-write.json new file mode 100644 index 00000000..499e7c48 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-write.json @@ -0,0 +1,31 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "type": "record", + "name": "table", + "fields": [{ + "name": "location", + "type": ["null", { + "type": "map", + "values": ["null", { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + }], + "key-id": 6, + "value-id": 7 + }], + "default": null, + "field-id": 5 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-write.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-write.yaml new file mode 100644 index 00000000..faf855d7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location-write.yaml @@ -0,0 +1,27 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + type: record + name: table + fields: + - name: location + type: + - 'null' + - type: map + values: + - 'null' + - type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 + key-id: 6 + value-id: 7 + default: null + field-id: 5 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location.json new file mode 100644 index 00000000..a49c689e --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location.json @@ -0,0 +1,17 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "type": "record", + "name": "r7", + "fields": [{ + "name": "lat", + "type": "float", + "field-id": 1 + }, { + "name": "long", + "type": ["null", "float"], + "default": null, + "field-id": 2 + }] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location.yaml new file mode 100644 index 00000000..232ce831 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/schema-location.yaml @@ -0,0 +1,14 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + type: record + name: r7 + fields: + - name: lat + type: float + field-id: 1 + - name: long + type: + - 'null' + - float + default: null + field-id: 2 diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/simple_record.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/simple_record.json new file mode 100644 index 00000000..0730227b --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/simple_record.json @@ -0,0 +1,11 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "type": "record", + "name": "SimpleRecord", + "fields" : [ + {"name": "value", "type": "int"}, + {"name": "nullableValue", "type": ["null","int"], "doc" : "doc"} + ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/simple_record.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/simple_record.yaml new file mode 100644 index 00000000..8eee36aa --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/simple_record.yaml @@ -0,0 +1,12 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + type: record + name: SimpleRecord + fields: + - name: value + type: int + - name: nullableValue + type: + - 'null' + - int + doc: doc diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/union_and_fixed_fields.json b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/union_and_fixed_fields.json new file mode 100644 index 00000000..a6d84671 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/union_and_fixed_fields.json @@ -0,0 +1,21 @@ +{ + "schemaFormat": "application/vnd.apache.avro;version=1.9.2", + "schema": { + "type" : "record", + "name" : "UnionAndFixedFields", + "doc" : "Schema for UnionAndFixedFields designed to trigger fixed compiler warnings in generated code", + "namespace" : "org.apache.avro.specific", + "fields" : [ { + "name" : "u", + "type" : [ "boolean", "int", "long", "float", "string" ] + }, + { + "name" : "l", + "type" : [ "string", { "type": "long", "logicalType": "timestamp-millis" } ] + }, + { + "name" : "f", + "type" : {"type": "fixed", "size": 16, "name": "md5"} + } ] + } +} \ No newline at end of file diff --git a/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/union_and_fixed_fields.yaml b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/union_and_fixed_fields.yaml new file mode 100644 index 00000000..b0b94ea7 --- /dev/null +++ b/asyncapi-core/src/test/resources/json/v3/schema/multiformat/avro/1.9.2/vnd.apache.avro/union_and_fixed_fields.yaml @@ -0,0 +1,26 @@ +schemaFormat: application/vnd.apache.avro;version=1.9.2 +schema: + type: record + name: UnionAndFixedFields + doc: >- + Schema for UnionAndFixedFields designed to trigger fixed compiler warnings + in generated code + namespace: org.apache.avro.specific + fields: + - name: u + type: + - boolean + - int + - long + - float + - string + - name: l + type: + - string + - type: long + logicalType: timestamp-millis + - name: f + type: + type: fixed + size: 16 + name: md5