kyungjunleeme commented on code in PR #53597:
URL: https://github.com/apache/airflow/pull/53597#discussion_r2232609478
##########
airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/openapi-gen/queries/queries.ts:
##########
@@ -6,11 +6,7 @@ import { LoginBody } from "../requests/types.gen";
import * as Common from "./common";
export const useSimpleAuthManagerLoginServiceCreateTokenAllAdmins = <TData =
Common.SimpleAuthManagerLoginServiceCreateTokenAllAdminsDefaultResponse, TError
= unknown, TQueryKey extends Array<unknown> = unknown[]>(queryKey?: TQueryKey,
options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) =>
useQuery<TData, TError>({ queryKey:
Common.UseSimpleAuthManagerLoginServiceCreateTokenAllAdminsKeyFn(queryKey),
queryFn: () => SimpleAuthManagerLoginService.createTokenAllAdmins() as TData,
...options });
export const useSimpleAuthManagerLoginServiceLoginAllAdmins = <TData =
Common.SimpleAuthManagerLoginServiceLoginAllAdminsDefaultResponse, TError =
unknown, TQueryKey extends Array<unknown> = unknown[]>(queryKey?: TQueryKey,
options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) =>
useQuery<TData, TError>({ queryKey:
Common.UseSimpleAuthManagerLoginServiceLoginAllAdminsKeyFn(queryKey), queryFn:
() => SimpleAuthManagerLoginService.loginAllAdmins() as TData, ...options });
-export const useSimpleAuthManagerLoginServiceCreateToken = <TData =
Common.SimpleAuthManagerLoginServiceCreateTokenMutationResult, TError =
unknown, TContext = unknown>(options?: Omit<UseMutationOptions<TData, TError, {
- requestBody: LoginBody;
-}, TContext>, "mutationFn">) => useMutation<TData, TError, {
- requestBody: LoginBody;
-}, TContext>({ mutationFn: ({ requestBody }) =>
SimpleAuthManagerLoginService.createToken({ requestBody }) as unknown as
Promise<TData>, ...options });
+export const useSimpleAuthManagerLoginServiceCreateToken = <TData =
Common.SimpleAuthManagerLoginServiceCreateTokenMutationResult, TError =
unknown, TContext = unknown>(options?: Omit<UseMutationOptions<TData, TError,
void, TContext>, "mutationFn">) => useMutation<TData, TError, void, TContext>({
mutationFn: () => SimpleAuthManagerLoginService.createToken() as unknown as
Promise<TData>, ...options });
Review Comment:
@bugraoz93
Thanks for the suggestion!
I think using @model_validator works well for post-processing or response
sanitization within the model, but in this case, we’re dealing with parsing
logic based on the incoming Content-Type header.
To make the request handling and OpenAPI schema explicit, I opted to use
FastAPI Depends with a custom header validator. It gives clearer control over
the request parsing and better aligns with FastAPI’s dependency injection
pattern.
--
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]