Open
Description
Description
In ModelBase.cpp, the default code generated for stringFromJson() is:
utility::string_t ModelBase::stringFromJson(web::json::value& val)
{
return val.is_string() ? val.as_string() : U("");
}
As you can see, this supplies an empty string when no value is given.
However, this is a problem if the field is flagged as a required field. If a required string field is missing, instead of getting a 500 Internal error response, the field is given a default value of "" and processed onward.
Swagger-codegen version
Using the new online editor on 13-JUL-2017. 3.x maybe?
Swagger declaration file content or url
ExampleContext:
type: object
required:
- taskName
- examName
properties:
taskName:
type: string
examName:
type: string