Add extra field to get_connnection REST endpoint (#13885)
This commit is contained in:
Родитель
31b956c6c2
Коммит
adf7755eaa
|
@ -25,7 +25,6 @@ from airflow.api_connexion.exceptions import AlreadyExists, BadRequest, NotFound
|
|||
from airflow.api_connexion.parameters import check_limit, format_parameters
|
||||
from airflow.api_connexion.schemas.connection_schema import (
|
||||
ConnectionCollection,
|
||||
connection_collection_item_schema,
|
||||
connection_collection_schema,
|
||||
connection_schema,
|
||||
)
|
||||
|
@ -58,7 +57,7 @@ def get_connection(connection_id, session):
|
|||
"Connection not found",
|
||||
detail=f"The Connection with connection_id: `{connection_id}` was not found",
|
||||
)
|
||||
return connection_collection_item_schema.dump(connection)
|
||||
return connection_schema.dump(connection)
|
||||
|
||||
|
||||
@security.requires_access([(permissions.ACTION_CAN_READ, permissions.RESOURCE_CONNECTION)])
|
||||
|
|
|
@ -116,6 +116,7 @@ class TestGetConnection(TestConnectionEndpoint):
|
|||
login='login',
|
||||
schema='testschema',
|
||||
port=80,
|
||||
extra="{'param': 'value'}",
|
||||
)
|
||||
session.add(connection_model)
|
||||
session.commit()
|
||||
|
@ -132,6 +133,7 @@ class TestGetConnection(TestConnectionEndpoint):
|
|||
"login": 'login',
|
||||
'schema': 'testschema',
|
||||
'port': 80,
|
||||
'extra': "{'param': 'value'}",
|
||||
}
|
||||
|
||||
def test_should_respond_404(self):
|
||||
|
|
Загрузка…
Ссылка в новой задаче