Input validation

Input validation consists of checking that the data received by an API respects the expected schema (field names, types, bounds, allowed values) before passing it to the model. Invalid requests are rejected with a clear error, which avoids absurd predictions or crashes.

Example

An age field of -5 or of text type is rejected with a 422 error before any prediction.

Related concepts

The whole glossary