-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate Date fields for "date-time" format #36
Comments
There's no way for this to work, because it would require the generated code to visit the entire object graph that after receiving / before sending to transform data. |
this could be optional for convenience, since it won't slow things any further than having to make the coversions in other places. |
Still, it would require the generated code to traverse the entire object graph before requests and after responses, and this is out-of-scope for |
Looks line ng-swagger-gen is not open for change requests. In my opinion, on client side we should have the exact same copy of the type models on server or it could be string | Date. |
"Looks line ng-swagger-gen is not open for change requests." When we started to work with Swagger in the Cyclos project, we didn't find a suitable generator and released ng-swagger-gen as open source in the hope it would be useful to others. Judging by the number of downloads, issues and pull requests, I'm particularly happy with the result. |
Agree with the default implementation, after considering different scenarios and putting some efforts in research, I also found that the JSON string is the correct format for the date/time type and it is your application's responsibility to play around with the conversion of string to datetime when required. |
In our Swagger, we have several fields of format "date-time" (type "string"). Currently, these are represented as string in the generated models.
It would be very convenient if these were generated as Date objects.
The text was updated successfully, but these errors were encountered: