Skip to content

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

@SamuelMarks

Description

@SamuelMarks

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):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions