Skip to content

Instantly share code, notes, and snippets.

@candostdagdeviren
Created May 21, 2017 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save candostdagdeviren/5dfcbbea52476c32b0de1cde14c2d2a6 to your computer and use it in GitHub Desktop.
Save candostdagdeviren/5dfcbbea52476c32b0de1cde14c2d2a6 to your computer and use it in GitHub Desktop.
Vapor 1 -> 2 Migration
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