示例#1
0
class RamlQueryParameter(Model):
    name = String()
    description = String()
    example = Or(String(),Int(),Float())
    displayName = String()
    type = String()
    enum = List(Or(String(),Float(),Int()))
    pattern = String()
    minLength = Int()
    maxLength = Int()
    repeat = Bool()
    required = Bool()
    default = Or(String(),Int(),Float())
    minimum = Or(Int(),Float())
    maximum = Or(Int(),Float())
示例#2
0
class RamlNamedParameters(Model):
    """ http://raml.org/spec.html#named-parameters """
    displayName = String()
    description = String()
    type = Choice(default='string', choices=NAMED_PARAMETER_TYPES)
    name = String()
    example = Or(String(), Int(), Float())
    enum = List(Or(String(), Float(), Int()))
    pattern = String()
    minLength = Int()
    maxLength = Int()
    repeat = Bool()
    required = Bool()
    default = Or(String(), Int(), Float())
    minimum = Or(Int(), Float())
    maximum = Or(Int(), Float())
示例#3
0
class RamlRoot(SecuredEntity, Model):
    """ http://raml.org/spec.html#root-section """
    raml_version = String(required=True)
    title = String(required=True)
    version = Or(String(), Int(), Float())
    baseUri = String(required=True)
    protocols = List(
        Choice(field_name='protocols', choices=RAML_VALID_PROTOCOLS))
    mediaType = String()
    documentation = List(Reference(RamlDocumentation))
    traits = Map(String(), Reference(RamlTrait))
    resources = Map(String(), Reference(RamlResource))
    resourceTypes = Map(String(), Reference(RamlResourceType))
    schemas = Map(String(), Or(JSONData(), XMLData(), String()))
    baseUriParameters = RamlNamedParametersMap()
    securitySchemes = Map(String(), Reference(RamlSecurityScheme))
示例#4
0
class RamlBody(Model):
    """ A method's body is defined in the body property as a hashmap,
    in which the key MUST be a valid media type.
    """
    schema = Or(JSONData(), XMLData(), String())
    example = String()
    notNull = Bool()
    formParameters = RamlNamedParametersMap()
示例#5
0
class SecuredEntity(object):
    # [foo, {bar: {baz: [buz]}}, null]
    securedBy = List(
        Or(String(), Map(String(), Map(String(), List(String()))), Null()))
示例#6
0
class ResourceTypedEntity(object):
    """ Represents entities that may have resourceTypes
    specified in ``type`` field.
    """
    type = Or(String(), Map(String(), Map(String(), String())))
示例#7
0
class RamlSecurityScheme(Model):
    """ http://raml.org/spec.html#security """
    description = String()
    type = String()
    describedBy = Reference(RamlSecuritySchemeDescription)
    settings = Map(String(), Or(String(), List(String())))
示例#8
0
class TraitedEntity(object):
    """ Represents entities that may have traits specified
    in ``is`` field.
    """
    is_ = List(Or(String(), Map(String(), Map(String(), String()))),
               field_name='is')