Decorator that specify the argument types of an exposed function.
Parameters: |
|
---|
Most of the time this decorator is not supposed to be used directly, unless you are not using WSME on top of another framework.
If an adapter is used, it will provide either a specialised version of this decororator, either a new decorator named @wsexpose that takes the same parameters (it will in addition expose the function, hence its name).
Complex type attribute definition.
Example:
class MyComplexType(wsme.types.Base):
optionalvalue = int
mandatoryvalue = wsattr(int, mandatory=True)
named_value = wsattr(int, name='named.value')
After inspection, the non-wsattr attributes will be replaced, and the above class will be equivalent to:
class MyComplexType(wsme.types.Base):
optionalvalue = wsattr(int)
mandatoryvalue = wsattr(int, mandatory=True)
A specialised property to define typed-property on complex types. Example:
class MyComplexType(wsme.types.Base):
def get_aint(self):
return self._aint
def set_aint(self, value):
assert avalue < 10 # Dummy input validation
self._aint = value
aint = wsproperty(int, get_aint, set_aint, mandatory=True)
Default value of the complex type attributes.
Root controller for webservices.
Parameters: |
|
---|
Returns a wsgi application
Enable a new protocol on the controller.
Parameters: | protocol – A registered protocol name or an instance of a protocol. |
---|
Returns the api description.
Return type: | list of (path, FunctionDefinition) |
---|
An argument definition of an api entry
argument name
Data type
True if the argument is mandatory
Default value if argument is omitted
An api entry definition
Function name
Function documentation
Return type
The function arguments (list of FunctionArgument)
If the body carry the datas of a single argument, its type
Status code
True if extra arguments should be ignored, NOT inserted in the kwargs of the function and not raise UnknownArgument exceptions
name of the function argument to pass the host request object. Should be set by using the wsme.types.HostRequest type in the function @:function:`signature`
Dictionnary of protocol-specific options.
Returns the FunctionDefinition of a method.
Returns a FunctionArgument from its name