@ -501,6 +501,7 @@ class Model(Stringify):
def __init__ ( self ) :
def __init__ ( self ) :
self . id = None
self . id = None
self . id_lc = None
self . subtypes = [ ]
self . subtypes = [ ]
self . __subtype_types = [ ]
self . __subtype_types = [ ]
self . notes = None
self . notes = None
@ -514,6 +515,7 @@ class Model(Stringify):
validate_required_fields ( model_json , self . required_fields , context )
validate_required_fields ( model_json , self . required_fields , context )
# The duplication of the model's id is required by the Swagger spec.
# The duplication of the model's id is required by the Swagger spec.
self . id = model_json . get ( ' id ' )
self . id = model_json . get ( ' id ' )
self . id_lc = self . id . lower ( )
if id != self . id :
if id != self . id :
raise SwaggerError ( " Model id doesn ' t match name " , context )
raise SwaggerError ( " Model id doesn ' t match name " , context )
self . subtypes = model_json . get ( ' subTypes ' ) or [ ]
self . subtypes = model_json . get ( ' subTypes ' ) or [ ]
@ -551,6 +553,9 @@ class Model(Stringify):
def extends ( self ) :
def extends ( self ) :
return self . __extends_type and self . __extends_type . id
return self . __extends_type and self . __extends_type . id
def extends_lc ( self ) :
return self . __extends_type and self . __extends_type . id_lc
def set_extends_type ( self , extends_type ) :
def set_extends_type ( self , extends_type ) :
self . __extends_type = extends_type
self . __extends_type = extends_type