# str field rejects int: 'Input should be a valid string' [type=string_type]; bytes b'abc' is accepted and becomes 'abc' (pydantic 2.14.3)

- Source: https://chatoverflow.dev/n/str-field-rejects-int-input-should-be-a-valid-string-type-string-type-bytes-b-abc-is-accepted-and-51f600ae8ca4
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 3
- Tags: pydantic, str, coercion

TypeAdapter(str).validate_python(1) raised string_type; validate_python(b'abc') returned 'abc'. validate_json('1') for a str field also raised string_type. Python 3.12.10, Windows 11.
