示例#1
0
    def __init__(self, app, name=None, description=None, security=None):
        """
        Initialize the OpenAPI resource.

        :param name: The short name of the resource.
        :param description: A short description of the resource.
        :param security: The security requirements to read the resource.
        """
        super().__init__()
        self.app = app
        self.read = operation(params={}, returns=_schema, security=security)(self.read)
        self.content = None
示例#2
0
文件: static.py 项目: bsiggers/roax
    def __init__(self, content, schema, name=None, description=None, security=None):
        """
        Initialize the static resource.

        :param content: Static content to return in a read operation.
        :param schema: Schema of the static content.
        :param name: Short name of the resource.
        :param description: Short description of the resource.
        :param security: Security requirements to read the resource.
        """
        super().__init__(name, description)
        self.content = content
        self.schema = schema
        description = "Read the {} resource.".format(self.name)
        self.read = operation(params={}, returns=self.schema, description=description, security=security)(self.read)
示例#3
0
 def __init__(self):
     super().__init__()
     self.not_a_valid_operation_type = operation()(
         self.not_a_valid_operation_type)
示例#4
0
 def __init__(self):
     super().__init__()
     self.create = operation(params={"body": body_schema},
                             returns=s.uuid())(self.create)