I’ve just updated to v.4.5.10 and I’m noticing two issues that are making the schema generated by the openapi plugin invalid.
First, the parameters array defining my request contain both ‘form’ and ‘body’ parameters. I did not specify ‘form’ in the ApiMemeberAttribute on the properties. Further - I’ve notices that I can have both ‘form’ and ‘formData’ depending on how I set the ‘DisableAutoDtoInBodyParam’ and that doesn’t seem right. I want body only. I wrote a filter to remove the form parameters but it seems like a hack.
Second, in the spec, in the response object the description is a required field. My default responses do not have a description. How can I add it? Again I’ve used a filter to ‘hack’ one in but it is just that - a hack.
Relevant section of JSON:
"parameters": [
{
"name": "MID",
"in": "path",
"type": "string",
"required": true
},
{
"name": "UserName",
"in": "form",
"type": "string",
"required": true
},
{
"name": "Type",
"in": "form",
"type": "string",
"required": true,
"enum": [
"Merchant",
"API"
]
},
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/GatewayCredentialRequest"
}
}
],
"responses": {
"default": {
"schema": {
"$ref": "#/definitions/GatewayCredentialResponse"
}
}
},
Request DTO:
[Route("/gatewaycredential/{MID}", "POST, OPTIONS")]
[DataContract]
public class GatewayCredentialRequest : IReturn<GatewayCredentialResponse>
{
[ApiMember(IsRequired = true, ExcludeInSchema = true, ParameterType = "path")]
[DataMember]
public string MID { get; set; }
[ApiMember(IsRequired = true)]
[DataMember]
public string UserName { get; set; }
[ApiMember(IsRequired = true)]
[ApiAllowableValues("Type", Values = new string[] { "Merchant", "API" })]
[DataMember]
public string Type { get; set; }
}
I can provide more details if needed. I also had to modify the swagger-ui javascript code to get oauth2 within swagger to work with servicestack’s JWT provider. Seemed like those should work together by default…