diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 1d79af3..fb05e2b 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "avro" -version = "0.1.3" +version = "1.0.0" authors = ["Ballerina"] export=["avro"] keywords = ["avro", "serialization", "deserialization", "serdes"] @@ -18,8 +18,8 @@ graalvmCompatible = true [[platform.java17.dependency]] groupId = "io.ballerina.lib" artifactId = "avro-native" -version = "0.1.3" -path = "../native/build/libs/avro-native-0.1.3-SNAPSHOT.jar" +version = "1.0.0" +path = "../native/build/libs/avro-native-1.0.0-SNAPSHOT.jar" [[platform.java17.dependency]] groupId = "org.apache.avro" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 02a1600..e770f53 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -10,7 +10,7 @@ distribution-version = "2201.9.0" [[package]] org = "ballerina" name = "avro" -version = "0.1.3" +version = "1.0.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..cdf13c9 --- /dev/null +++ b/changelog.md @@ -0,0 +1,12 @@ +# Change Log + +This file contains all the notable changes done to the Ballerina Avro package through the releases. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to +[Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.0.0] - 2024-05-13 + +### Added + +- [[#6463] Introduce `byte` support to Avro module](https://github.com/ballerina-platform/ballerina-library/issues/6463) diff --git a/docs/spec/spec.md b/docs/spec/spec.md index 73c8bce..b8a9a03 100644 --- a/docs/spec/spec.md +++ b/docs/spec/spec.md @@ -25,7 +25,7 @@ The conforming implementation of the specification is released and included in t * 3.1 [The `toAvro` API](#31-the-toavro-api) * 3.1.1 [API Parameters](#311-api-parameters) * 3.1.1.1 [The `data` Parameter](#3111-the-data-parameter) - * 3.1.1.1.1 [Accepted Ballerina types](#31111-accepted-ballerina-types) + * 3.1.1.1.1 [Map Avro types to Ballerina Types](#31111-map-avro-types-to-ballerina-types) * 3.1.2 [Return type](#312-return-type) 4. [Deserialize bytes to a specific Ballerina type](#4-deserialize-bytes-to-a-specific-ballerina-type) * 4.1 [The `fromAvro` API](#41-the-fromavro-api) @@ -74,11 +74,27 @@ byte[] serializedData = check schema.toAvro("avro-data"); The `data` parameter accepts the following Ballerina data types that is needed to be serialized into `byte` array. -###### 3.1.1.1.1 Accepted Ballerina types +###### 3.1.1.1.1 Map Avro types to Ballerina Types -* `json` -* `enum` -* `record` +The following table summarizes how Avro types are mapped to corresponding Ballerina types. These rules are applicable when serializing/deserializing Ballerina data according to an Avro schema. + +| Avro Type | Ballerina Type | +|--------------|----------------| +| null | nil | +| boolean | boolean | +| int,long | int | +| float,double | float | +| bytes | byte[] | +| string | string | +| record | record | +| enum | enum | +| array | array | +| map | map | +| fixed | byte[] | + +>**Note:** The Ballerina [`int`](https://ballerina.io/spec/lang/2023R1/#section_5.2.3) type can represent integers up to 64 bits in size using the two's complement representation. Therefore, it can handle both `int` (32-bit signed integer) and `long` (64-bit signed integer) Avro types. + +>**Note:** The Ballerina [`float`](https://ballerina.io/spec/lang/2023R1/#section_5.2.4.1) type supports the IEEE 754-2008 64-bit binary (radix 2) floating-point number standard. Therefore, it can handle both `float` (32-bit single precision IEEE 754 floating-point number) and `double` (64-bit double precision IEEE 754 floating-point number) Avro types. #### 3.1.2 Return type diff --git a/gradle.properties b/gradle.properties index 81030da..16d3c85 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ org.gradle.caching=true group=io.ballerina.lib -version=0.1.3-SNAPSHOT +version=1.0.0-SNAPSHOT ballerinaLangVersion=2201.9.0 checkstylePluginVersion=10.12.0