Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use as a JSON-schema to Python class library? #68

Open
SamuelMarks opened this issue Mar 25, 2018 · 0 comments
Open

Use as a JSON-schema to Python class library? #68

SamuelMarks opened this issue Mar 25, 2018 · 0 comments

Comments

@SamuelMarks
Copy link

Looking through your docs, looks like this kind of thing should be possible.

Getting blank output currently, but what do you think?

In [1]: from cStringIO import StringIO
In [2]: from elasticgit.commands.avro import SchemaLoader
In [3]: SchemaLoader().run([StringIO('{"title": "Person","type": "object","properties": {"firstName": {"type": "string"},"lastName": {"type": "string"},"age": {"description": "Age in years","type": "integer","minimum": 0}},"required": ["firstName", "lastName"]}')])
# NOTE:
#
#   This is an automatically generated Elasticgit Model definition
#   from an Avro schema. Do not manually edit this file unless you
#   absolutely know what you are doing.
#
# namespace: 
#
# VERSION INFO:
#
#   package:          elastic-git
#   package_version:  1.5.0
#   language_version: 2.7.14
#

from elasticgit import models


class (models.Model):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant