[csharp] date proper format (#5734)

* [csharp] Honor Swagger/OpenAPI 'date' format

Per spec
(https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types),
DateTime instances defined as 'date' datatype need to be serialized as
defined by full-date - RFC3339, which has the format:

full-date       = date-fullyear "-" date-month "-" date-mday

ref:
https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14

see #5513
see #5531

* [csharp] Regenerate sample

* [csharp] Include date format test
This commit is contained in:
Jim Schubert
2017-06-04 12:57:00 -04:00
committed by wing328
parent d5b3cc0534
commit bc8fe0fd03
42 changed files with 197 additions and 2 deletions

View File

@@ -312,6 +312,8 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
clientPackageDir, "ApiResponse.cs"));
supportingFiles.add(new SupportingFile("ExceptionFactory.mustache",
clientPackageDir, "ExceptionFactory.cs"));
supportingFiles.add(new SupportingFile("SwaggerDateConverter.mustache",
clientPackageDir, "SwaggerDateConverter.cs"));
if(Boolean.FALSE.equals(this.netStandard) && Boolean.FALSE.equals(this.netCoreProjectFileFlag)) {
supportingFiles.add(new SupportingFile("compile.mustache", "", "build.bat"));
supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "build.sh"));