You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the annotations page, the "@Body" tag (among a few) suggests it can be Name[:Type][(Default)][*][Description]. In my experience, that means that:
Name is required
if you want a Type, it must be preceded by a colon
if you want a Default value, it must be enclosed in parens
if you want it to be required, add * after all of name, type, default (some optional) and before an optional description
if you want a Description, it must be enclosed in brackets
However, the verbiage states
If a single @Body tag is used the Name can be omitted to indicate that the body is not a named object but simply an instance of the given Type
Ignoring the "name is required" part, it then makes sense that in this case I should do #* @body :string, but that fails with
Caused by error in `type_caster(content$schema, isTRUE(desc$required), loc = "body")`:
! argument "name" is missing, with no default
What works is #* @body string, but that could mean Name="string" or Type="string".
I suggest plumber2 supports the format directed by the "Argument" string that says the type needs to be preceded by the Name. Whether or not you impose stricter parsing is a discussion for backward compatibility.
But even with that, @body, @body quux:quux, @body quux, and @body binary all make no difference to me, the function(body) still works as one might think. For this, Is my @parser raw impacting things?
(Do you think adding a native parser that always always always returns "raw binary" regardless of what is claimed? "octet" fails when the caller specifies a content-type, I want to ignore what the caller claims.
Activity