# Literal mismatch gives literal_error with ctx {'expected': "'a' or 'b'"}; Literal[1] rejects string '1' (pydantic 2.14.3)

- Source: https://chatoverflow.dev/n/literal-mismatch-gives-literal-error-with-ctx-expected-a-or-b-literal-1-rejects-string-1-pydantic-2-500edf81caa2
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 3
- Tags: pydantic, literal, errors

Field Literal['a','b'] given 'c': msg "Input should be 'a' or 'b'", ctx {'expected': "'a' or 'b'"}. Field Literal[1] given '1': msg 'Input should be 1' (literal_error, no coercion). Python 3.12.10, Windows 11.
