RobbeSneyders commented on code in PR #39055:
URL: https://github.com/apache/airflow/pull/39055#discussion_r1567861339
##########
airflow/cli/commands/internal_api_command.py:
##########
@@ -198,7 +198,8 @@ def start_and_monitor_gunicorn(args):
def create_app(config=None, testing=False):
"""Create a new instance of Airflow Internal API app."""
- flask_app = Flask(__name__)
+ connexion_app = connexion.FlaskApp(__name__)
Review Comment:
Yes that sounds fine.
##########
airflow/api_connexion/endpoints/connection_endpoint.py:
##########
@@ -91,7 +91,7 @@ def get_connection(*, connection_id: str, session: Session =
NEW_SESSION) -> API
@provide_session
def get_connections(
*,
- limit: int,
+ limit: int | None = None,
Review Comment:
I can't immediately think of a change that could trigger this. I tried to
reproduce it with a minimal example, but it works as expected:
```python
def insert(**kwargs):
def decorator(f):
async def wrapped_function():
return await f(**kwargs)
return wrapped_function
return decorator
@insert(name="Igor")
async def post_greeting(name: str):
return f"Hello {name}", 200
```
```yaml
paths:
/greeting:
post:
operationId: hello.post_greeting
parameters:
- name: name
in: query
schema:
type: string
```
Do you have a stack trace by any chance?
##########
airflow/www/extensions/init_views.py:
##########
@@ -220,90 +203,100 @@ def resolve(self, operation):
return _LazyResolution(self.resolve_function_from_operation_id,
operation_id)
-class _CustomErrorRequestBodyValidator(RequestBodyValidator):
Review Comment:
Yes, this was merged upstream in
https://github.com/spec-first/connexion/pull/1761
##########
airflow/providers/fab/auth_manager/fab_auth_manager.py:
##########
@@ -147,19 +149,24 @@ def get_cli_commands() -> list[CLICommand]:
SYNC_PERM_COMMAND, # not in a command group
]
- def get_api_endpoints(self) -> None | Blueprint:
+ def set_api_endpoints(self, connexion_app: connexion.FlaskApp) -> None:
folder = Path(__file__).parents[0].resolve() # this is
airflow/auth/managers/fab/
with folder.joinpath("openapi", "v1.yaml").open() as f:
specification = safe_load(f)
- return FlaskApi(
+
+ swagger_ui_options = SwaggerUIOptions(
Review Comment:
Yes, the ownership of the bundled Swagger UI has been donated to our
spec-first organization, so we no longer have a dependency on third-party
maintainers to update this.
##########
airflow/api_connexion/openapi/v1.yaml:
##########
@@ -2186,6 +2171,30 @@ paths:
'404':
$ref: '#/components/responses/NotFound'
+ /datasets/{uri}:
Review Comment:
Thanks, this is a [known
change](https://connexion.readthedocs.io/en/latest/v3.html#:~:text=Route%20priority%20changed.%20The%20most%20specific%20route%20should%20now%20be%20defined%20first%20in%20the%20specification.)
compared to Connexion 2 due to different route priority in Starlette compared
to Flask. There is an [open
PR](https://github.com/spec-first/connexion/pull/1898) to handle this
automatically by sorting the paths before registering them. So this should be
fixed soon.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]