Skip to content

A search which returns zero results fails #1

@winstonewert

Description

@winstonewert

Usually the api comes back looking something like this:

'search_info': {'total_results': '2950', 'search_time': '0.46'}

But when I run a search which returns no results:

'search_info': {'total_results': 0, 'search_time': '0.34'}

You'll notice the total results is number zero, rather than a string.

This causes:

pydantic_core._pydantic_core.ValidationError: 1 validation error for SearchResponse
total_results
  Input should be a valid string [type=string_type, input_value=0, input_type=int]
    For further information visit https://errors.pydantic.dev/2.12/v/string_typepydantic_core._pydantic_core.ValidationError: 1 validation error for SearchResponse
total_results
  Input should be a valid string [type=string_type, input_value=0, input_type=int]
    For further information visit https://errors.pydantic.dev/2.12/v/string_type

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions