Hi,
i want to change the type in swagger ui from form (Parametertype) to body.
How can i change this or setup so it’s default this way?
Regards Kristian
mythz
January 9, 2020, 2:53pm
2
You can change ParameterType
used with [ApiMember]
attribute however body wont work as the body is the entire Request / Response DTO, not a single property.
Here are some existing threads for background info:
If you want to use
SaveWorkflow_POST(string name, string description, DefObject definition, string[] actions, Guid projectid)
instead of
SaveWorkflow_POST(Workflow data,Guid projectid)
you should use this DTO
public class WorkflowPostRequest: IReturn<Workflow>
{
public Guid ProjectId { get; set; }
public Workflow workflow { get; set; }
}
instead of deriving request from Workflow class. And in that case Workflow parameter will be incapsulated in Open API parameter w…
The Open API Specification returns a JSON format that’s serialized using these properties , ServiceStack contains Typed DTO’s that maps 1:1 to the v2 specification, so using the available filters you should be able to return the custom Open API definition for the operation you need.
There can only be 1 body, which should be left as the Request DTO, that represents the Request body. The parameters in the /path/info are excluded in the body. For the other parameters you can make them optional Quer…
Any additional customizations can be applied using Operation Filters which lets you modify the returned typed DTO representing the OpenApi v2 specification .