-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Milestone
Description
Description
If a definition in a swagger spec contains a field with format: date, the corresponding c# field is of type NodaTime.ZonedDateTime. This is wrong as a date field itself does not carry any time/time-zone information. One particular problem with this is that the corresponding field is serialized wrongly as a RFC3339 full-time instead of a full-date.
Swagger-codegen version
2.3.0-Snapshot
Swagger declaration file content or url
swagger: "2.0"
info:
version: "1.0.0"
title: Demo
paths:
/foo:
get:
summary: "foo"
responses:
200:
description: successful
schema:
$ref: '#/definitions/bar'
definitions:
bar:
type: object
properties:
createdOn:
type: string
format: dateCommand line used for generation
generate -i dummy.yaml -o . -l nancyfx --additional-properties packageContext=v1,interfacePrefix=I,useDateTimeOffset=true
Steps to reproduce
Generate the nancy client with the above command line and open Bar.cs
Related issues/PRs
There is no related issue that I'm aware of.
Suggest a fix/enhancement
Use NodaTime.LocalDate instead and add a Nancy.Json.JavaScriptPrimitiveConverter that uses the RFC3339 full-date pattern.
Reactions are currently unavailable