Skip to content

A custom Robot Framework library for serializing JSON messages to Avro binary format using user-defined schemas.

License

Notifications You must be signed in to change notification settings

darioajr/AvroSerializer

Repository files navigation

Robot Avro Serializer

Python Robot Framework License

Robot Avro Serializer is a custom Robot Framework library written in Python to serialize JSON messages into binary Avro format using user-defined schemas.


Features

  • ✅ Load Avro schema from .avsc files
  • 🔄 Serialize JSON objects into Avro binary
  • 📦 Return binary as hexadecimal string
  • 🤖 Seamless integration with Robot Framework

Installation

pip install robotframework AvroSerializer

Usage Example

Robot Test:

*** Settings ***
Library    AvroSerializer

*** Variables ***
${SCHEMA_FILE}    example_schema.avsc
${JSON_MSG}       {"name": "Ana", "age": 30, "email": "ana@email.com"}

*** Test Cases ***
Serialize JSON To Avro
    Load Avro Schema From File    ${SCHEMA_FILE}
    ${hex}=    Serialize And Return Hex    ${JSON_MSG}
    Log    Serialized Avro Hex: ${hex}

example_schema.avsc

{
  "type": "record",
  "name": "User",
  "fields": [
    { "name": "name", "type": "string" },
    { "name": "age", "type": "int" },
    { "name": "email", "type": ["null", "string"], "default": null }
  ]
}

Development

git clone https://github.com/darioajr/AvroSerializer.git
cd AvroSerializer
pip install .

License

This project is licensed under the Apache-2.0 License.

About

A custom Robot Framework library for serializing JSON messages to Avro binary format using user-defined schemas.

Resources

License

Stars

Watchers

Forks

Packages

No packages published