Skip to content

Ошибка валидации Pydantic в методе get_fetch_ips_result #54

Description

@BabayVadimovich

ip_result = await remnawave.ip_control.get_fetch_ips_result(jobId=ip_job.job_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "venv/lib/python3.12/site-packages/remnawave/rapid/decorators.py", line 43, in wrapper
return api._handle_response(response, response_class=response_class)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "venv/lib/python3.12/site-packages/remnawave/rapid/client.py", line 129, in _handle_response
return response_class.model_validate(data["response"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "venv/lib/python3.12/site-packages/pydantic/main.py", line 705, in model_validate
return cls.pydantic_validator.validate_python(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 2 validation errors for FetchIpsResultResponseDto
result.nodes.0.ips.0
Input should be a valid string [type=string_type, input_value={'ip': '', 'la...26-06-14T15:46:08.000Z'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.11/v/string_type
result.nodes.0.ips.1
Input should be a valid string [type=string_type, input_value={'ip': '', 'l...26-06-14T15:46:05.000Z'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.11/v/string_type

Ошибка здесь:

class FetchIpsNodeResult(BaseModel):
    """Per-node IP list for a user"""
    node_uuid: UUID = Field(alias="nodeUuid")
    node_name: str = Field(alias="nodeName")
    country_code: str = Field(alias="countryCode")
    ips: List[str]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions