Extend JSON.lower instead of JSON.print - #65
Merged
Conversation
4 tasks
|
|
||
| JSON._print(io::IO, state::JSON.State, d::Base.Dates.Date) = | ||
| JSON._print(io, state, "$(Base.Dates.year(d))-$(Base.Dates.month(d))-$(Base.Dates.day(d))") | ||
| JSON.lower(d::Base.Dates.Date) = |
Contributor
Author
There was a problem hiding this comment.
Is there a reason you have this definition? I believe it is redundant with the one defined in JSON.jl.
Contributor
Author
There was a problem hiding this comment.
Ah, I see that this feature was introduced only starting v0.5.1. Also, this version will serialize dates as 2016-8-19—the JSON version is 2016-08-19. I think the latter would probably work in your case too, in which case this line can be safely deleted.
Member
|
This looks great, thanks! We can definitely get rid of that definition for Base.Dates.Date. Will merge when the tag has been merged to METADATA |
Also delete obsolete `Date` serialization.
Contributor
Author
|
Should be good to merge now. Restarting travis. |
JSON.lower instead of JSON.printJSON.lower instead of JSON.print
Member
|
Thank you! Failing test is my fault and has been fixed on master. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In JSON v0.7.0 and beyond, overloads of _print are deprecated in favour of overloading the simpler lower function.
The new JSON tag is not yet merged; see JuliaLang/METADATA.jl#5988. I'll ping you when it is.