liveBook · Manning

Server validation

As explained in Building Web APIs with ASP.NET Core

Server-side validation is the checking of request input by the server before accepting or processing that input.

Server validation checks request input before the server accepts or processes it. Unlike SwaggerUI’s client-side checks, it protects the request boundary because client checks can be bypassed. section 6.1.4

Use the generated API description to understand the input rules that clients should follow:

  • Inspect swagger.json to find parameter types, formats, defaults, minimums, maximums, and patterns. section 6.1.4
  • Treat SwaggerUI feedback as user-experience assistance, not as a security control; invalid values may be rejected before any request is sent. section 6.1.4

GET /BoardGames parameters

A PageSize query parameter can be documented as an integer with a default of 10 and limits from 1 through 100. SwaggerUI uses that metadata to flag clearly invalid input, such as text supplied where an integer is expected, before executing the call. section 6.1.4

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Distinguishes client-side checks from security-relevant server validation, but does not provide server-validation implementation steps.
Examples
Uses GET /BoardGames parameters, PageSize range constraints, invalid integer input, and ASC|DESC sort-order patterns.
What you can do after
Evaluate input-validation behavior by inspecting OpenAPI metadata and testing parameters through SwaggerUI.
How it connects
Connects server validation with client-side validation, model binding, OpenAPI, and SwaggerUI.

Also explained in

Compare how 3 books explain server validation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.