class documentation

class Schemas(object):

Constructor: Schemas(discovery)

View In Hierarchy

Schemas for an API.

Method __init__ Constructor.
Method get Get deserialized JSON schema from the schema name.
Method prettyPrintByName Get pretty printed object prototype from the schema name.
Method prettyPrintSchema Get pretty printed object prototype of schema.
Instance Variable pretty Undocumented
Instance Variable schemas Undocumented
Method _prettyPrintByName Get pretty printed object prototype from the schema name.
Method _prettyPrintSchema Get pretty printed object prototype of schema.
def __init__(self, discovery):

Constructor.

Parameters
discoveryobject, Deserialized discovery document from which we pull out the named schema.
def get(self, name, default=None):

Get deserialized JSON schema from the schema name.

Parameters
namestring, Schema name.
defaultobject, return value if name not found.
def prettyPrintByName(self, name):

Get pretty printed object prototype from the schema name.

Parameters
namestring, Name of schema in the discovery document.
Returns
string, A string that contains a prototype object with
comments that conforms to the given schema.
def prettyPrintSchema(self, schema):

Get pretty printed object prototype of schema.

Parameters
schemaobject, Parsed JSON schema.
Returns
string, A string that contains a prototype object with
comments that conforms to the given schema.
pretty: dict =

Undocumented

schemas =

Undocumented

@util.positional(2)
def _prettyPrintByName(self, name, seen=None, dent=0):

Get pretty printed object prototype from the schema name.

Parameters
namestring, Name of schema in the discovery document.
seenlist of string, Names of schema already seen. Used to handle recursive definitions.
dentUndocumented
Returns
string, A string that contains a prototype object with
comments that conforms to the given schema.
@util.positional(2)
def _prettyPrintSchema(self, schema, seen=None, dent=0):

Get pretty printed object prototype of schema.

Parameters
schemaobject, Parsed JSON schema.
seenlist of string, Names of schema already seen. Used to handle recursive definitions.
dentUndocumented
Returns
string, A string that contains a prototype object with
comments that conforms to the given schema.