Created
May 21, 2017 05:56
-
-
Save candostdagdeviren/5dfcbbea52476c32b0de1cde14c2d2a6 to your computer and use it in GitHub Desktop.
Vapor 1 -> 2 Migration
This file contains 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
extension User: JSONRepresentable { | |
func makeJSON() throws -> JSON { | |
var json = JSON() | |
try json.set("id", id?.string) | |
try json.set("name", name) | |
try json.set("score", score) | |
return json | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment