示例#1
0
    def __init__(
            self, http_status, description, headers=None, content=None,
            links=None, extensions=None):
        self.http_status = http_status
        self.description = description
        self.headers = headers and dict(headers) or {}
        self.content = content and Content(content) or Content()
        self.links = links and dict(links) or {}

        self.extensions = extensions and dict(extensions) or {}
示例#2
0
    def create(self, content_spec):
        media_types = self.media_types_generator.generate(content_spec)

        return Content(media_types)
示例#3
0
    def __init__(self, content, required=False, extensions=None):
        self.content = Content(content)
        self.required = required

        self.extensions = extensions and dict(extensions) or {}
示例#4
0
 def __init__(self, content, required=False):
     self.content = Content(content)
     self.required = required