Asterisk - The Open Source Telephony Project GIT-master-27fb039
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Static Public Attributes
Property Class Reference
Inheritance diagram for Property:
Inheritance graph
[legend]
Collaboration diagram for Property:
Collaboration graph
[legend]

Public Member Functions

 __init__ (self, name)
 
 load (self, property_json, processor, context)
 
- Public Member Functions inherited from Stringify
 __repr__ (self)
 

Data Fields

 description
 
 name
 
 required
 
 required_fields
 
 type
 

Static Public Attributes

list required_fields = ['type']
 

Detailed Description

Model of a Swagger property.

See https://github.com/wordnik/swagger-core/wiki/datatypes

Definition at line 471 of file swagger_model.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  name 
)

Definition at line 479 of file swagger_model.py.

479 def __init__(self, name):
480 self.name = name
481 self.type = None
482 self.description = None
483 self.required = None
484

Member Function Documentation

◆ load()

load (   self,
  property_json,
  processor,
  context 
)

Definition at line 485 of file swagger_model.py.

485 def load(self, property_json, processor, context):
486 validate_required_fields(property_json, self.required_fields, context)
487 # Bit of a hack, but properties do not self-identify
488 context = context.next_stack({'name': self.name}, 'name')
489 self.description = property_json.get('description') or ''
490 self.required = property_json.get('required') or False
491
492 type = property_json.get('type')
493 self.type = type and SwaggerType().load(type, processor, context)
494
495 processor.process_property(self, context)
496 return self
497
498

Referenced by ApiDeclaration.load_file(), and ResourceListing.load_file().

Field Documentation

◆ description

description

Definition at line 482 of file swagger_model.py.

◆ name

name

Definition at line 480 of file swagger_model.py.

Referenced by PathSegment.get_child(), and SwaggerType.load().

◆ required

required

Definition at line 483 of file swagger_model.py.

◆ required_fields [1/2]

list required_fields = ['type']
static

Definition at line 477 of file swagger_model.py.

◆ required_fields [2/2]

required_fields

Definition at line 486 of file swagger_model.py.

◆ type

type

Definition at line 481 of file swagger_model.py.


The documentation for this class was generated from the following file: