|
@@ -409,16 +409,11 @@ class Hapic(object):
|
409
|
409
|
if not route.endswith('/'):
|
410
|
410
|
route = '{}/'.format(route)
|
411
|
411
|
|
412
|
|
- # Add swagger directory as served static dir
|
413
|
412
|
swaggerui_path = os.path.join(
|
414
|
413
|
os.path.dirname(os.path.abspath(__file__)),
|
415
|
414
|
'static',
|
416
|
415
|
'swaggerui',
|
417
|
416
|
)
|
418
|
|
- self.context.serve_directory(
|
419
|
|
- route,
|
420
|
|
- swaggerui_path,
|
421
|
|
- )
|
422
|
417
|
|
423
|
418
|
# Documentation file view
|
424
|
419
|
doc_yaml = self.doc_generator.get_doc_yaml(
|
|
@@ -428,7 +423,7 @@ class Hapic(object):
|
428
|
423
|
description=description,
|
429
|
424
|
)
|
430
|
425
|
|
431
|
|
- def spec_yaml_view():
|
|
426
|
+ def spec_yaml_view( *args, **kwargs):
|
432
|
427
|
return self.context.get_response(
|
433
|
428
|
doc_yaml,
|
434
|
429
|
mimetype='text/x-yaml',
|
|
@@ -445,7 +440,7 @@ class Hapic(object):
|
445
|
440
|
)
|
446
|
441
|
|
447
|
442
|
# Declare the swaggerui view
|
448
|
|
- def api_doc_view():
|
|
443
|
+ def api_doc_view(*args, **kwargs):
|
449
|
444
|
return self.context.get_response(
|
450
|
445
|
doc_page_content,
|
451
|
446
|
http_code=HTTPStatus.OK,
|
|
@@ -465,3 +460,9 @@ class Hapic(object):
|
465
|
460
|
http_method='GET',
|
466
|
461
|
view_func=spec_yaml_view,
|
467
|
462
|
)
|
|
463
|
+
|
|
464
|
+ # Add swagger directory as served static dir
|
|
465
|
+ self.context.serve_directory(
|
|
466
|
+ route,
|
|
467
|
+ swaggerui_path,
|
|
468
|
+ )
|