pennsignals / aptos

:sunny: A tool for validating data using JSON Schema and converting JSON Schema documents into different data-interchange formats
Apache License 2.0
150 stars 22 forks source link

Add support for Google Protocol Buffers #7

Open jasonwalsh opened 7 years ago

jasonwalsh commented 7 years ago

Currently, aptos supports converting JSON Schema documents into the Apache Avro data-interchange format.

A proposed class in the visitor module (e.g ProtobufSchemaVisitor) should yield the converted Protocol Buffers document.

ghost commented 7 years ago

Your issue doesn't follow our guidelines. Please fix the following:

Click here for details.

Thank you! :pray: This comment was made by GitMagic – Magically enforcing your contribution guidelines.

ghost commented 7 years ago

Your issue doesn't follow our guidelines. Please fix the following:

Click here for details.

Thank you! :pray: This comment was made by GitMagic – Magically enforcing your contribution guidelines.

ghost commented 7 years ago

Thank you, everything looks good now! :bowtie:

subhajeet2107 commented 6 years ago

Hey i can help with this, can you tell me what should be the output ? For example , i should be able to do : aptos convert -format protobuf example-schema.json and aptos should output .proto defination file for the given schema ? is this requirement correct ?

jasonwalsh commented 6 years ago

Hey @subhajeet2107, thank you for your interest in contributing! Yes, your command: aptos convert -format protobuf example-schema.json is correct.

Something like:

{
    "title": "Person",
    "type": "object",
    "properties": {
        "firstName": {
            "type": "string"
        }
    },
    "required": [ "firstName" ]
}

Would yield the following .proto file:

message Person {
    required string firstName = 1;
}

That's a really basic example, but I think starting with the primitive types, (e.g. string, integer, number, boolean, etc.) would be the easiest and then we can focus on the more complex types like array(s), object(s), enumeration(s), etc.

malrusha commented 6 years ago

Hi @rightlag are you open to using a template engine like Jinja2 for this?

jasonwalsh commented 6 years ago

Hi @malrusha, that's a great idea! I'm fine with using a template system like Jinja2.

runflowcode commented 6 years ago

Hi, what would be the latest expected release date for protocol buffer support ?

jasonwalsh commented 6 years ago

Hi @blaisezzz, I'd like to have support for protocol buffers by mid to late October.

jasonwalsh commented 6 years ago

I've created a new branch feature/protobuf to track all changes. I'll be updating shortly.

ajainuary commented 6 years ago

@jasonwalsh since this thread has been inactive for quite a while, can I work on this ?

jasonwalsh commented 6 years ago

Hi @ajainuary

Thank you for your interest in the project! Sure, that would be great! 👍

Feel free to submit a PR.

Nayan-Das commented 5 years ago

can I take this up?

jasonwalsh commented 5 years ago

@Nayan-Das Sure!

Nayan-Das commented 5 years ago

Ok..I am working on it.

domu904 commented 5 years ago

It looks like this is still open. Any change in the requirement?