Giter VIP home page Giter VIP logo

rsgen-avro's Introduction

Tools

Libraries

Experiments

rsgen-avro's People

Contributors

batconjurer avatar bemyak avatar codehearts avatar gudjonragnar avatar ilikepi63 avatar lerouxrgd avatar martin-g avatar mjgarton avatar oshevtsov avatar pilocchii avatar sneakyberry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rsgen-avro's Issues

Support recursive types

The following schema causes a segfault for me, this schema is taken from the offical apache avro test suite: https://github.com/apache/avro/blob/main/share/test/schemas/interop.avsc

{"type": "record", "name":"Interop", "namespace": "org.apache.avro",
  "fields": [
      {"name": "intField", "type": "int"},
      {"name": "longField", "type": "long"},
      {"name": "stringField", "type": "string"},
      {"name": "boolField", "type": "boolean"},
      {"name": "floatField", "type": "float"},
      {"name": "doubleField", "type": "double"},
      {"name": "bytesField", "type": "bytes"},
      {"name": "nullField", "type": "null"},
      {"name": "arrayField", "type": {"type": "array", "items": "double"}},
      {"name": "mapField", "type":
       {"type": "map", "values":
        {"type": "record", "name": "Foo",
         "fields": [{"name": "label", "type": "string"}]}}},
      {"name": "unionField", "type":
       ["boolean", "double", {"type": "array", "items": "bytes"}]},
      {"name": "enumField", "type":
       {"type": "enum", "name": "Kind", "symbols": ["A","B","C"]}},
      {"name": "fixedField", "type":
       {"type": "fixed", "name": "MD5", "size": 16}},
      {"name": "recordField", "type":
       {"type": "record", "name": "Node",
        "fields": [
            {"name": "label", "type": "string"},
            {"name": "children", "type": {"type": "array", "items": "Node"}}]}}
  ]
}

System information

$ uname -a
Linux fastpanda 6.5.0-26-generic #26-Ubuntu SMP PREEMPT_DYNAMIC Tue Mar  5 21:19:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Glob pattern generates Invalid arguments.

When using the cli with multiple avsc files like: rsgen-avro my/schemas/**/*.avsc test.rs.
It generates a space separated list of files and I think the last argument as output file is missing.
I guess adding a flag instead of using the last argument could help.

allow mut

Maybe it could be a good idea to add

#[allow(unused_mut)]

at the begining of the file
To prevent some warnings on collections ?

Array of Records not supported ?

Hi,

Thank you for making this project.

However this schema is not supported:

{
  "type": "record",
  "name": "Object",
  "namespace": "",
  "doc": "",
  "fields": [
    {
      "name":  "field",
      "default": null,
      "type": [
        "null", {
          "type": "array",
          "items": {
            "name": "Variable",
            "type": "record",
            "fields": [
              {"name": "key", "type": "int", "doc":  ""},
              {"name": "val",  "type":  "string", "doc":  ""}
            ]
          }
        }
      ]
    }
  ]
}
thread 'main' panicked at 'called `Result::unwrap()` on an `Err`

value: Template("Didn\'t find schema 
Array(Record { name: Name { name: \"Variable\", namespace: None, aliases: None }, doc: None, fields: [
RecordField { name: \"key\", doc: Some(\"\"), default: None, schema: Int, order: Ascending, position: 0 }, 
RecordField { name: \"val\", doc: Some(\"\"), default: None, schema: String, order: Ascending, position: 1 }
], 

lookup: {\"key\": 0, \"val\": 1} }) in state GenState({})")', src/libcore/result.rs:1165:5

I think that we need to adjust this function, right?
https://github.com/lerouxrgd/rsgen-avro/blob/master/src/templates.rs#L673

Named dependent schemas

I am working with a lot of named schemas defined in different files and trying to generate structs. I have boiled it down to a simple example with two struct defined in separate files where A includes B:

# schemas/a.avsc
{
  "namespace": "a",
  "type": "record",
  "name": "A",
  "fields": [
    {"name": "first", "type": "b.B"},
    {"name": "second", "type": "b.B"}
  ]
}

# schemas/b.avsc
{
  "namespace": "b",
  "type": "record",
  "name": "B",
  "fields": [
    {"name": "first", "type": "string"}
  ]
}

I then have a simple script to read the two schemas and parse them using version 0.14.0 of the apache-avro crate before trying to generate a struct representation of A.

use std::fs::File;

use apache_avro::Schema;
use rsgen_avro::{Generator, Source};

fn main() {
    let path = std::env::current_dir().unwrap();
    let mut out_path = path.to_owned();
    out_path.push("output");

    let mut raw_schemas = Vec::new();
    for schema in &["schemas/b.avsc", "schemas/a.avsc"] {
        let mut p = path.to_owned();
        p.push(*schema);
        dbg!(&p);
        raw_schemas.push(std::fs::read_to_string(&p).unwrap());
    }
    let schemas = &raw_schemas.iter().map(|s| s.as_str()).collect::<Vec<_>>();
    let schemas = Schema::parse_list(&schemas).unwrap();
    dbg!(&schemas);

    let to_generate = "a";
    let mut tmp_path = out_path.to_owned();
    tmp_path.push(&format!("{}.rs", to_generate));
    std::fs::create_dir_all(tmp_path.parent().unwrap()).expect("Failed creating dirs");
    let mut out = File::create(&tmp_path).unwrap();
    let generator = Generator::builder().build().unwrap();
    generator
        .gen(&Source::Schema(schemas.get(1).unwrap()), &mut out)
        .unwrap();
}

The script fails at the generation step because apache-avro now writes the schema for A using Schema::Ref for the B struct, which is not handled. The error I get is

thread 'main' panicked at 'Schema reference 'Name { name: "B", namespace: Some("b") }' cannot be resolved', /..../rsgen-avro-0.11.0/src/templates.rs:376:25

Here you can see the schema parsed by apache-avro

    Record {
        name: Name {
            name: "A",
            namespace: Some(
                "a",
            ),
        },
        aliases: None,
        doc: None,
        fields: [
            RecordField {
                name: "first",
                doc: None,
                default: None,
                schema: Ref {
                    name: Name {
                        name: "B",
                        namespace: Some(
                            "b",
                        ),
                    },
                },
                order: Ascending,
                position: 0,
            },
            RecordField {
                name: "second",
                doc: None,
                default: None,
                schema: Ref {
                    name: Name {
                        name: "B",
                        namespace: Some(
                            "b",
                        ),
                    },
                },
                order: Ascending,
                position: 1,
            },
        ],
        lookup: {
            "first": 0,
            "second": 1,
        },
    }

I guess this could be solved in two ways:

  1. Add an option to apache-avro to inline the dependent schemas
  2. Add an option ot rsgen-avro to supply dependent schemas to generator and lookup the schema to generate.

...or if I am doing something wrong it would be great to get some feedback on that.

Unable to generate proper rust code for the record

Hello,
Thank you for your efforts. This is a very promising crate.

I just tried to use the generator for a record like that:

{
    "name": "Attribute",
    "namespace": "vision.module",
    "type": "record",
    "fields": [
        {
            "name": "element_name",
            "type": "string",
            "doc": "Element name that created this attribute, e.g. 'age-gender'."
        },
        {
            "name": "name",
            "type": "string",
            "doc": "Attribute name, e.g. 'age'."
        },
        {
            "name": "value",
            "type": [
                "string",
                "int",
                "float",
                {
                    "type": "array",
                    "items": "float"
                }
            ],
            "doc": "Attribute value, e.g. ReID array, class label/ID, age, etc."
        },
        {
            "name": "confidence",
            "type": [
                "null",
                "float"
            ],
            "default": null
        }
    ]
}

Unfortunately, the generator cannot generate proper code.

/// Auto-generated type for unnamed Avro union variants.
#[derive(Debug, PartialEq, Clone, serde::Serialize)]
pub enum UnionStringIntFloatArrayOk("Float") {
    String(String),
    Int(i32),
    Float(f32),
    ArrayFloat(Vec<f32>),
}

impl From<String> for UnionStringIntFloatArrayOk("Float") {
    fn from(v: String) -> Self {
        Self::String(v)
    }
}

Union with a record

Hello
I try to generate rust code form a set of avsc files.
I get an error. Here is a minimal example generating the same error:

Templating error: Requires Schema::Union, found Record { name: Name { name: "B", namespace: None }, aliases: None, doc: None, fields: [RecordField { name: "pass", doc: None, default: None, schema: Long, order: Ascending, position: 0 }, RecordField { name: "direction", doc: None, default: None, schema: Ref { name: Name { name: "C", namespace: None } }, order: Ascending, position: 1 }, RecordField { name: "depth", doc: None, default: None, schema: Double, order: Ascending, position: 2 }], lookup: {"depth": 2, "direction": 1, "pass": 0} }

I think the problem is line 662 in templates.rs. I guess a reference to another schema should not only return a str_union_enum ?

{
	"type": "record",
	"name": "A",
	"fields":
	[
		{"name": "item",
			"type": [
				"null",
				"long",
				"double",
				"B"
			]
		}
	]
}
{
	"type": "record",
	"name": "B",
	"fields":
	[
		{ "name": "pass", "type": "long" },
		{ "name": "direction", "type": "C" },
		{ "name": "depth", "type": "double" }
	]
}
{
	"type": "enum",
	"name": "C",
	"symbols":
	[
		"U",
		"S",
		"D"
	]
}

Support for union of records

rsgen-avro rejects the following schema with an error AvroRs error: Unions cannot contain duplicate types:

{
    "type": "record",
    "name": "Foo",
    "fields": [
        {"name": "a", "type": "int"},
        {"name": "b",
         "type":
            [
                {
                    "type": "record",
                    "name": "Bar",
                    "fields": [
                        {"name": "c", "type": "long"}
                    ]
                },
                {
                    "type": "record",
                    "name": "Baz",
                    "fields": [
                        {"name": "d", "type": "int"}
                    ]
                }
            ]
        }
    ]
}

Is the schema wrong (I don't think so)? If so, how should it be fixed? Otherwise, resgen-avro need so to be fixed. I suspect it is confusedly thinking that Bar and Baz are the same thing simply because of the type of record.

The error vanishes when I replace the Baz record block with "int" or "long", but that's not the union I want to express.

Improve handling of 'out of order' schema inclusion

ResolvedSchema does not seem to do a good job of handling out of order ref dependencies.

For example, if schema 'b' includes 'a' as a ref, Schema::parse_list appears to require 'a' to appear before 'b'.

Currently testing an improved strategy locally.

Templating error: Io error while writing rendered value to output: NotADirectory

Hi,

whene I run the following command
./.cargo/bin/rsgen-avro ./RawResponse_1.json -
I get the following error
Templating error: Io error while writing rendered value to output: NotADirectory

My Avro schemma is preatty long, if you need I can link it, but it seems a problem with paths, not with schema content.

Thanks,
Dario

Union types should allow "null" in any position

Using the following schema:

{
    "type": "record",
    "name": "test",
    "fields": [
        {"name": "a", "type": ["long","null"] }
    ]
}

rsgen-avro errors with:

Templating error: Invalid Schema::Null not in first position on an UnionSchema variants

I don't see a requirement in the avro spec about this (we do have additional requirements when we have a default value, but this doesn't apply here).

issue sanitize function

I have this schema:

{
	"type": "enum",
	"namespace": "Energistics.Etp.v12.Datatypes.Object",
	"name": "ContextScopeKind",
	"symbols":
	[
		"self",
		"sources",
		"targets",
		"sourcesOrSelf",
		"targetsOrSelf"
	]
}

rsgen-avro generates this Enum type:

#[derive(Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Clone, serde::Deserialize, serde::Serialize)]
pub enum ContextScopeKind {
    #[serde(rename = "self")]
    r#Self,
    #[serde(rename = "sources")]
    Sources,
    #[serde(rename = "targets")]
    Targets,
    #[serde(rename = "sourcesOrSelf")]
    SourcesOrSelf,
    #[serde(rename = "targetsOrSelf")]
    TargetsOrSelf,
}

The sanitize function may have an issue. It should generate rSelf instead

Implementation of Default trait for records with Uuid fields is invalid

Given the schema:

{
  "type": "record",
  "name": "ExampleRecord",
  "fields": [
    {
      "name": "foo",
      "type": "string",
      "logicalType": "uuid"
    }
  ]
}

The following code is generated:

#[derive(Debug, PartialEq, Clone, serde::Deserialize, serde::Serialize)]
#[serde(default)]
pub struct ExampleRecord {
    pub foo: uuid::Uuid,
}

impl Default for ExampleRecord {
    fn default() -> ExampleRecord {
        ExampleRecord {
            foo: 00000000-0000-0000-0000-000000000000,
        }
    }
}

This fails to compile because of 00000000-0000-0000-0000-000000000000 on line 11, rustc thinks it's a sequence of integers:

expected struct `Uuid`, found integer

I appreciate your work. Let me know if I can be of any help.

upstream apache-avro

Would it be possible to have a develop branch and a CI able to point to the upstream version of the apache-avro crate ?

support of namespace field

Hi,

I have a bunch an .avpr file (or a bunch of .avsc files) for whom I want to generate rust traits. These schemas are organized into namespaces.
I would like to give a try to implement a possible solution. I though about modules but I am beginner in rust. Do you think it could be a good solution to organize the files and the code into a crate ?

support of metadata

Hi,

I have avro schemas where metadata have been introduced for records.
As written in the doc:

A JSON object, of the form:

{"type": "typeName" ...attributes...}

where typeName is either a primitive or derived type name, as defined below. Attributes not defined in this document are permitted as metadata, but must not affect the format of serialized data.

But has someone a idea how I could generate these metadata as part of an avro trait without serializing them ?
Maybe: #[serde(skip)] to skip both serialization and deserialization ?

Whould you accept a PR with such a feature ?

Union with a single type

I wanted to test https://issues.apache.org/jira/browse/AVRO-3946 and I observe a strange behavior.

avro-3946.avsc:

{
  "type": "record",
  "name": "Issue",
  "namespace": "invalid.example",
  "fields": [
    {
      "name": "myField",
      "type": ["long"]
    }
  ]
}
$ ./target/release/rsgen-avro avro-3946.avsc -

#[derive(Debug, PartialEq, Eq, Clone, serde::Deserialize, serde::Serialize)]
pub struct Issue {
    #[serde(rename = "myField")]
    pub my_field: UnionLong,
}

UnionLong enum is not declared! Neither any of the From/TryFrom impls.

In addition, I agree with the reporter of https://issues.apache.org/jira/browse/AVRO-3946 that such single type unions should be simplified to non-union, if possible.

rsgen-avro throws error when --nullable param is used.

Problem:

rsgen-avro throws error "Templating error: Failed to render 'record.tera'" when --nullable is used

Replication Steps:

  1. Put the two files (attached below in the zip) in the same directory
  2. run: rsgen-avro --nullable "*.avsc" schema.rs

Note: removing --nullable, and no error is thrown.

Archive.zip

Avro 0.16 wrongly fails on date examples

          Interestingly 0.16 cannot parse this schema anymore:
{
  "type": "record",
  "name": "DateLogicalType",
  "fields": [ {
    "name": "birthday",
    "type": {"type": "int", "logicalType": "date"},
    "default": 1681601653
  } ]
}

It says:
default's value type of field "birthday" in "DateLogicalType" must be "{\"type\":\"int\",\"logicalType\":\"date\"}"

However this one is fine:

{
  "type": "record",
  "name": "DateLogicalType",
  "fields": [ {
    "name": "release_datetime_micro",
    "type": {"type": "long", "logicalType": "timestamp-micros"},
    "default": 1570903062000000
  } ]
}

@martin-g Do you know where I should report this ?

Originally posted by @lerouxrgd in #60 (comment)

Panic index out of range

Encountering a panic on the following line, should perhaps the index be 0 as the length is 1?

} else if variants.len() == 1 && variants[1] == Schema::Null {

I have a rather large Avro schema and having trouble pin-pointing exactly which field is producing this behaviour.

Union of more than three items fails

Schema:

{
  "type": "record",
  "name": "Contact",
  "namespace": "com.test",
  "fields": [
    {
      "name": "extra",
      "type": "map",
      "values" : [ "null", "string", "long", "double", "boolean" ]
    }
  ]
}

error:

Problem during code generation: Templating error: Didn't find schema Union(UnionSchema { schemas: [Null, String, Long, Double, Boolean], variant_index: {Boolean: 4, String: 1, Null: 0, Long: 2, Double: 3} }) in state GenState({})

This also fails with the following:

{
  "type": "record",
  "name": "Contact",
  "namespace": "com.test",
  "fields": [
    {
      "name": "extra",
      "type" : [ "null", "string", "long", "double", "boolean" ]
    }
  ]
}

If I reduce the values array to just "null" and "string" it works fine.

Let me know if you need any more info :)

Struct ordering

Just started using this, its great but because of this issue: flavray/avro-rs#47 i have had to manually reorder the fields in the generated struct. Would it be possible to maintain the ordering in the schema in the struct also?

Deserializing from avro_rs to rsgen_avro union fails with "not an enum"

I'm trying to deserialize an avro_rs::types::Value to a struct generated by rsgen_avro, but the deserialization fails on the Option<UnionIntLong> field with avro_rs saying "not an enum".

/// Auto-generated type for unnamed Avro union variants.
#[derive(Debug, PartialEq, Clone, serde::Deserialize, serde::Serialize)]
pub enum UnionIntLong {
    Int(i32),
    Long(i64),
}

#[derive(Debug, PartialEq, Clone, serde::Deserialize, serde::Serialize)]
#[serde(default)]
pub struct Event {
    pub a: Option<UnionIntLong>,
}

impl Default for Event {
    fn default() -> Event {
        Event { a: None }
    }
}

let avro_value = Value::Record(vec![
    ("a".to_string(), Value::Union(Box::new(Value::Int(123))))
]);

let my_event = from_value::<Event>(&avro_value)?; // Err(avro_rs::Error::DeserializeValue("not an enum"))

What's happening?

The issue seems to be avro_rs using a custom deserializer, which the serde-generated implementation for UnionIntLong calls deserialize_enum on. Since the Avro-encoded union doesn't contain an enum, the deserialization fails.

I've set up a repo with a full reproduction of the issue and 2 proposed solutions. Both solutions might need to be behind a feature flag, since they may be breaking changes.

An easy fix

  • Annotate the rsgen_avro-generated union type with #[serde(untagged)]
    • Caveat: Avro long types get deserialized to the UnionIntLong::Int variant

In my case, the caveat is fine because I'm casting both variants to a single Rust type in my codebase anyway.

A painful fix

  • Remove the #[derive(serde::Deserialize)] annotation from the union type
  • Create a custom serde::de::Visitor for the union type
  • Implement serde::Deserializer for the union type using the custom visitor

This deserializes Avro types to their correct variants, so a long would deserialize as UnionIntLong::Long. The downside is how much additional code and complexity this adds.


There might be a better way of handling this, and maybe avro_rs is the right crate to implement a fix for this in, but I thought I'd open an issue here and see what the thoughts are.

Support logical date and timestamp types

I need support for:

{"name":"day", "type" : {"type":"int", "logicalType":"date"}},

and

{"name":"start",            "type" : {"type":"long", "logicalType":"timestamp-millis"}},

Cannot generate an Optional array

A schema with the following field fails to generate rust code:

    {
      "name": "GROUP_NAMES",
      "type": [
        "null",
        {
          "type": "array",
          "items": [
            "null",
            "string"
          ]
        }
      ],
      "default": null
    }

with the error

Problem during code generation: Templating error: Didn't find schema Array(Union(UnionSchema { schemas: [Null, String], variant_index: {Null: 0, String: 1} })) in state GenState({4431444975918093497: "Vec<Option>", 2318155486020329502: "Option"})

Given optional fields are handled elsewhere, I would expect this to generate a field of type:

Option<Vec<Option<String>>>

This came up trying to use a schema generated by ksqlDB - in a ksqlDB stream all fields are optional, and this is the schema it outputs for an ARRAY<VARCHAR(STRING)> field.

Remove Default trait for whole structure

My suggestion is to use field default for fields that provides default in avro schema instead implement default for whole structure.
I need to check required fields during deserailaztion instead get all fields filled by default values.

Unable to make it work for nested types in different Schema Files.

Looking for guidance on how to make rsgen-Avro and avro-rust work when there are multiple schema files, where one file relies on a type in another file.

rsgen-avro seems to create the schema's correctly.
Schema::parse_list seems to parse the schema's correct.

Writer throws validation errors. (i've also trying using more lower level primatives, such as to_avro_datum, same issue)
Line 81 in the sample code below: Err(SchemaResolutionError(Name { name: "ErrorInfo", namespace: Some("Energistics.Etp.v12.Datatypes") }))

Sample code to show the issue:
NOTES:
-- This is a subset of what I need to do. The full Schema definition I need to use is 200+ .AVSC files, with multiple nested / reused types.
-- I can't change the structure of the Schema files, as this is a Published Industry Standard in our domain for data interchange using a wire protocol. (I will actually use to_avro_datum for the final version, as we just want the raw bytes, not the headers etc).
-- I'm getting some other errors with the rsgen (serde-bytes, and unable to use derive-schemas) that might post seperatly. I can share the full set of schema's if it is usefull for debugging.

Sample code showing the problem.


// Test File
use apache_avro::{Schema, Writer};

// Structs Generated from rsgen-avro with commandline -->   rsgen-avro  "*.avsc" schema.rs
// Interestingly trying to use "--nullable" in rsgen-avro throws an error "Templating error: Failed to render 'record.tera'" might need to look at that seperatly.
//
#[derive(Debug, PartialEq, Eq, Clone, serde::Deserialize, serde::Serialize)]
pub struct ProtocolException {
   pub error: Option<ErrorInfo>,
   #[serde(default = "default_protocolexception_errors")]
   pub errors: ::std::collections::HashMap<String, ErrorInfo>,
}

#[inline(always)]
fn default_protocolexception_errors() -> ::std::collections::HashMap<String, ErrorInfo> {
   ::std::collections::HashMap::new()
}

#[derive(Debug, PartialEq, Eq, Clone, serde::Deserialize, serde::Serialize)]
pub struct ErrorInfo {
   pub message: String,
   pub code: i32,
}

// Main Test
fn main() {
   let errinfo_schema = r#"
   {
       "type": "record",
       "namespace": "Energistics.Etp.v12.Datatypes",
       "name": "ErrorInfo",
       "fields":
       [
           { "name": "message", "type": "string" },
           { "name": "code", "type": "int" }
       ]
   }
   "#;

   let protocolexception_schema = r#"
   {
       "type": "record",
       "namespace": "Energistics.Etp.v12.Protocol.Core",
       "name": "ProtocolException",
       "protocol": "0",
       "messageType": "1000",
       "senderRole": "*",
       "protocolRoles": "client, server",
       "multipartFlag": true,
       "fields":
       [
           { "name": "error", "type": ["null", "Energistics.Etp.v12.Datatypes.ErrorInfo"] },
           {
               "name": "errors",
               "type": { "type": "map", "values": "Energistics.Etp.v12.Datatypes.ErrorInfo" }, "default": {}
           }
       ]
   }
   "#;

   let schema_list: [&str; 2] = [protocolexception_schema, errinfo_schema];
   let schemas_raw = Schema::parse_list(&schema_list);

   println!("{:?}", schemas_raw);
   println!("{:?}", "--------------");

   let schemas = schemas_raw.unwrap();

   let pe = ProtocolException {
       error: Some(ErrorInfo {
           message: String::from("some Error Message"),
           code: 451,
       }),
       errors: ::std::collections::HashMap::new(),
   };

   println!("{:?}", schemas[0]); // The 'ProtocolException' Schema in the list
   println!("{:?}", "--------------");

   let mut writer = Writer::new(&schemas[0], Vec::new()); // <-- Should I be able to pass the 'list' of Schema's here somewhere, so it resolves all the sub types ?

   let result = writer.append_ser(pe); // <-- Schema Resolution Error !  Missing the ErrorInfo Subtype
   println!("{:?}", result);

   let encoded = writer.into_inner();
   println!("{:?}", encoded);

   // Equivelent READER code to go here, once WRITER works.
}


Cannot generate code from directories with cross dependencies

Suppose I have a directory with two files: Thing.avsc and UUID.avsc with the following contents:

// Thing.avsc
{
	"name": "Thing",
	"type": "record",
	"fields": [
		{"name": "id", "type": "UUID"},
		{"name": "other", "type": "float"}
	]
}

// UUID.avsc
{
	"name": "UUID",
	"type": "record",
	"fields": [
		{"name": "bytes", "type": "bytes"}
	]
}

Code generation fails with Avro failure: Failed to parse schema: Unknown type: UUID because the current code generation does not seem to support cross depencies.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.