mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-10 04:19:37 +00:00
Fix parameters in the CLI interface
This commit is contained in:
@@ -83,22 +83,27 @@ def run(spec_file,
|
||||
logging_level = logging.DEBUG
|
||||
logging.basicConfig(level=logging_level)
|
||||
|
||||
sys.path.insert(1, path.abspath(base_path or '.'))
|
||||
spec_file_full_path = path.abspath(spec_file)
|
||||
base_path = base_path or path.dirname(spec_file_full_path)
|
||||
sys.path.insert(1, path.abspath(base_path))
|
||||
|
||||
resolver_error = None
|
||||
if stub:
|
||||
resolver_error = 501
|
||||
|
||||
app = App(__name__)
|
||||
app.add_api(path.abspath(spec_file), resolver_error=resolver_error)
|
||||
app.run(
|
||||
port=port,
|
||||
server=wsgi_server,
|
||||
swagger_json=hide_spec or None,
|
||||
swagger_ui=hide_console_ui or None,
|
||||
swagger_path=console_ui_from or None,
|
||||
swagger_url=console_ui_url or None,
|
||||
strict_validation=strict_validation,
|
||||
validate_responses=validate_responses,
|
||||
auth_all_paths=auth_all_paths,
|
||||
debug=debug)
|
||||
app = App(__name__,
|
||||
swagger_json=hide_spec is False,
|
||||
swagger_ui=hide_console_ui is False,
|
||||
swagger_path=console_ui_from or None,
|
||||
swagger_url=console_ui_url or None,
|
||||
auth_all_paths=auth_all_paths,
|
||||
debug=debug)
|
||||
|
||||
app.add_api(spec_file_full_path,
|
||||
resolver_error=resolver_error,
|
||||
validate_responses=validate_responses,
|
||||
strict_validation=strict_validation)
|
||||
|
||||
app.run(port=port,
|
||||
server=wsgi_server,
|
||||
debug=debug)
|
||||
|
||||
@@ -38,13 +38,6 @@ def test_run_simple_spec(mock_app_run, spec_file):
|
||||
mock_app_run.run.assert_called_with(
|
||||
port=default_port,
|
||||
server=None,
|
||||
strict_validation=False,
|
||||
swagger_json=None,
|
||||
swagger_path=None,
|
||||
swagger_ui=None,
|
||||
swagger_url=None,
|
||||
auth_all_paths=False,
|
||||
validate_responses=False,
|
||||
debug=False)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user