Skip to content
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

IntDate is not supported in AutoRest #909

Closed
pomortaz opened this issue Mar 31, 2016 · 2 comments
Closed

IntDate is not supported in AutoRest #909

pomortaz opened this issue Mar 31, 2016 · 2 comments
Assignees
Milestone

Comments

@pomortaz
Copy link

IntDate is integer representation of UNIX origin time used in JSON Web Token(JWT). Key Vault REST API has an attribute class containing properties of type IntDate such as exp and nbf. However, IntDate is not supported in the AutoRest to convert the Unix time to DateTime which is consumable by the client side code. Is it possible to add IntDate support to AutoRest? This is similar to this issue.

To do so, we need to define a UnixTimeConverter that converts type of long to DateTime.
[JsonConverter(typeof (UnixTimeConverter))]

@markcowl
Copy link
Member

markcowl commented Apr 1, 2016

@pomortaz Is there a specification somewhere for exactly what intDate is? The JsonConverter is nice, but we will need to implement this in multiple languages, so a specification of the format would be useful

@pomortaz
Copy link
Author

pomortaz commented Apr 1, 2016

According to JSON Web Token (JWT) draft, InDate (which is called NumericDate now) is "A JSON numeric value representing the number of seconds from 1970-01-01T00:00:00Z UTC until the specified UTC date/time, ignoring leap seconds."

This is also known as Unix Time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants