ashb commented on code in PR #77113: URL: https://github.com/apache/airflow/pull/77113#discussion_r4633609539
########## airflow-core/src/airflow/api_fastapi/common/types.py: ########## @@ -71,6 +74,27 @@ class TimeDelta(BaseModel): TimeDeltaWithValidation = Annotated[TimeDelta, BeforeValidator(_validate_timedelta_field)] +class _SkipJsonValueWalk: + def __get_pydantic_core_schema__( + self, source_type: Any, handler: GetCoreSchemaHandler + ) -> core_schema.CoreSchema: + return core_schema.no_info_wrap_validator_function( + lambda value, _validate: value, + handler(source_type), + serialization=core_schema.plain_serializer_function_ser_schema(lambda value: value), + ) + + +DecodedJsonValue = Annotated[JsonValue, _SkipJsonValueWalk()] Review Comment: Is there really not a type built in to pydantic that does this already for us? -- 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]
