def nullable_schema(self, schema: core_schema.NullableSchema) -> JsonSchemaValue:
        """Generates an OpenAPI 2.0-compatible JSON schema that matches a schema that allows null values.

        (The catch is OpenAPI 2.0 does not allow them, but some clients are capable
        to consume the `x-nullable` annotation.)

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        """
        anyof_schema_value = super().nullable_schema(schema)
        elem = next(
            any_of
            for any_of in anyof_schema_value["anyOf"]
            if any_of.get("type") != "null"
        )
        if type := elem.get("type"):
            return {"type": type, "x-nullable": True}
        # Assuming a reference here (which we can not annotate)
        return elem  # type: ignore[no-any-return]
Generates an OpenAPI 2.0-compatible JSON schema that matches a schema that allows null values.

        (The catch is OpenAPI 2.0 does not allow them, but some clients are capable
        to consume the `x-nullable` annotation.)

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        
api/api/openapi.py