Skip to content

Commit

Permalink
Merge pull request #17 from Nuvindu/update-1.0.0
Browse files Browse the repository at this point in the history
Include the `byte` support feature into the specification
  • Loading branch information
Nuvindu committed May 13, 2024
2 parents 64f5404 + 7285e1d commit 1913304
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 10 deletions.
6 changes: 3 additions & 3 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -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"]
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
12 changes: 12 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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)
26 changes: 21 additions & 5 deletions docs/spec/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 1913304

Please sign in to comment.