Table of Contents

RDW00002: Several body parameters

Severity: Warning  ·  Family: RDW (RDCore.Web)  ·  Raised by: SeveralBodyParametersAnalyzer

A parameter of an action that takes a body is bound by neither the route nor the body.

A request has one body, and it binds one parameter: the one '@FromBody names, else, for a POST, a PUT or a PATCH, the first parameter the route does not bind. Every other parameter that the route does not bind takes its value from the query string, as the parameters of a GET do. A caller that sends that value in the JSON body does not reach it: the parameter receives nothing.

It is reported at each such parameter. A GET, a HEAD and an OPTIONS have no body and are never reported, nor is a DELETE with no '@FromBody, which binds no body.

How it is raised

Situation Example Resolution
A POST with two parameters the route does not bind. '@HttpPost above Public Function Place(ByVal order As Variant, ByVal note As Variant): the body binds to order, and note binds from the query string. Send note in the query string, or make it part of the object the body holds.
A POST whose '@FromBody names a later parameter. '@FromBody("note") above Public Function Place(ByVal order As Variant, ByVal note As Variant): order binds from the query string. Name the parameter the body holds, or bind the others in the route.

See also