How to use the fair.api_meta.Meta function in fair

To help you get started, we’ve selected a few fair examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github remyzane / fair-api / fair / app.py View on Github external
def api_decorator(self, view_func, rule=None, **options):

        http_methods = self.api_http_method(options)

        if rule not in self.api.url_map:
            self.add_url_rule(rule + '__doc', rule + ' DOC', doc_ui)
            self.add_url_rule(rule + '__exe', rule + ' EXE', exe_ui)
        rule = self.api_rule(view_func, http_methods, rule=rule)

        endpoint = self.api_endpoint(rule, http_methods, options)

        self.add_url_rule(rule, endpoint, view_func, **options)

        view_func.meta = Meta(self.api, view_func, rule, http_methods)