Closed
Description
I have a property name in my schema which is lower-case, e.g.:
*@swg\Definition(definition="TimeIntput", type="object",
* required={ "time" },
* @swg\Property(property="time", type="integer", description="timestamp"),
* )
This property should be included as part of a request body:
* @SWG\Parameter(name="Input", in="body", @SWG\Schema(ref="#/definitions/TimeInput")),
The CSharp code generator creates a class where the property name is capitalized according to the language conventions:
namespace io.swagger.Model {
public class TimeInput {
/* timestamp */
public int? Time { get; set; }
public override string ToString() {
var sb = new StringBuilder();
sb.Append("class TimeInput {\n");
sb.Append(" Time: ").Append(Time).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
}
When sending the request by APIInvoker, the CSharp object which is an instance of the above class is serialized so the parameter in the request body has the capitalized name.
This means that the server does not get the parameter with the expected name as defined in the schema.
Metadata
Metadata
Assignees
Labels
No labels