Validate all possible API param shapes / types

I am seeking some advice on how to properly validate all possible API params (and their types) for a given endpoint.

What kind of content type for POST’s body are you looking to validate? Is it JSON (like in the linked example), or is it arbitrary form data too?

If it’s JSON, would you consider following OpenAPI/Swagger approach, e.g. using a JSON Schema to validate the shape of incoming request? If yes, then perhaps you could get inspired from libraries that attempt to doing a similar thing, e.g. Xema and ExJsonSchema, see: Xema and JsonXema - Schema validatiors