patched flow2schema
 
Go to file
Paul Loyd 29348f75e0 Add support for named intersections 2017-11-03 10:34:36 +03:00
bin Project restructuring 2017-11-02 17:59:00 +03:00
lib Add support for named intersections 2017-11-03 10:34:36 +03:00
tests Add support for named intersections 2017-11-03 10:34:36 +03:00
.gitignore Feuer frei! 2017-10-29 01:55:39 +03:00
README.md Implement a scope for class methods 2017-11-03 01:27:00 +03:00
package.json Add test mechanism 2017-10-29 15:42:46 +03:00

README.md

flow2avro

Example

Input:

$ ./bin/flow2avro -
    interface Foo {
        foo: string,
        // $avro long
        bar: number,
        opt: ?number,
        baz: 'one' | 'two',
        mix: 'one' | 'two' | number,
    }

Output:

{
    Foo: {
        type: 'record',
        fields: [
            { name: 'foo', type: 'string' },
            { name: 'bar', type: 'long' },
            { name: 'opt', type: [ 'null', 'double' ] },
            { name: 'baz', type: { type: 'enum', symbols: [ 'one', 'two' ] } },
            { name: 'mix', type: [
                'double',
                { type: 'enum', symbols: [ 'one', 'two' ] }
            ] }
        ],
        name: 'Foo'
    }
}

TODO

  • Support extends and implements.
  • Generics.