-
-
Save kristofsajdak/d086b558b09f59455891 to your computer and use it in GitHub Desktop.
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
def defineRoute(routeBuilder) { | |
routeBuilder.categories { | |
schema { | |
properties { | |
name { | |
type string, | |
description "a name" | |
} | |
links { | |
brand "brands" | |
} | |
} | |
required ['name'] | |
name "Category" | |
} | |
get { req, res -> | |
// any kind of dynamic validation, custom authorization can be done in line | |
"people.get logic goes here" | |
} | |
.document { docs -> docs.summary = "Overridden summary for post"; doc } | |
post { req, res, data -> | |
"people.get logic goes here" | |
} | |
"{id}" { | |
get { req, res -> | |
"people/{id}/" | |
} | |
patch { req, res, data -> | |
"people/{id}/" | |
} | |
delete { req, res -> | |
"people/{id}/" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment