Ejemplo n.º 1
0
 def spawn_api(self, app, decorator=None):
     """Auto-generate server endpoints implementing the API into this Flask app"""
     if decorator:
         assert type(decorator).__name__ == 'function'
     self.is_server = True
     return spawn_server_api(self.name, app, self.api_spec, self.error_callback, decorator)
Ejemplo n.º 2
0
 def generate_server_app(self, yaml_str, callback=default_error_callback):
     swagger_dict = yaml.load(yaml_str)
     spec = ApiSpec(swagger_dict)
     app = Flask('test')
     spawn_server_api('somename', app, spec, callback, None)
     return app, spec