Skip to content

date/date-time model properties rendered as string in model/schema (v2.1.0-M2) #1183

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

Closed
zyro23 opened this issue Apr 18, 2015 · 8 comments
Closed

Comments

@zyro23
Copy link

zyro23 commented Apr 18, 2015

hi,

after updating 2.1.8-M1 to 2.1.0-M2, date/date-time properties are rendered as type "string" in the model schema view with a default value of "string".

previously, with 2.1.8-M1, they were rendered as type "date-time" with a default value of the current timestamp in iso format.

my model property definition did not change ({"type":"string","format":"date-time"}).

was the behavior changed intentionally? presetting the value with a valid iso date(-time) string was the better approach imho. or am i maybe missing something else that has changed and i need to adapt to?

thanks, zyro

@ponelat
Copy link
Contributor

ponelat commented Apr 23, 2015

hi @zyro23,

It seems there was a bug, but it's working in with our latest source, so you should see the expected behavior in the next release or so.

Note: latest source being ...
6f1b9b6
Built with swagger-client at....
swagger-api/swagger-js@83023ca

@webron
Copy link
Contributor

webron commented May 4, 2015

@zyro23 - can you retest as mentioned by @ponelat?

@zyro23
Copy link
Author

zyro23 commented May 4, 2015

hmm... no luck :(

this is supposed to be fixed/working with 6f1b9b6 right? i used the dist/swagger-ui.js from that revision (which is still the current develop_2.0 HEAD as of writing this..).

looking at the code, maybe the issue is that https://github.com/swagger-api/swagger-js/blob/master/lib/types/model.js#L347 checks for type === 'date-time' but as stated, my spec json contains {"type":"string","format":"date-time"}?

thanks, zyro

@ponelat
Copy link
Contributor

ponelat commented May 5, 2015

@zyro23, perhaps I wasn't clear enough...
The fix is in swagger-js, that's why I mentioned both SHAs.
Have a look at building from the bleeding edge....
#1220 (comment)

PS: I checked again, and the fix is there :)

@zyro23
Copy link
Author

zyro23 commented May 5, 2015

fix confirmed working.

just made first contact with node/npm/gulp ;) went smooth with the provided pr comment. thx guys!

@webron
Copy link
Contributor

webron commented May 6, 2015

Thanks for the update, closing for now. Please reopen if needed.

@grouchal
Copy link

This seems to be happening in the current version - is this tested for the in the current tests?

@ghost
Copy link

ghost commented Jun 28, 2016

+1

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