Created
October 7, 2022 12:05
-
-
Save s1monw1/496972a4a37e227333ed14c981b1e819 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
// lens focusing on the path variable name | |
val nameLens = Path.string().of("name") | |
// lens focusing on a required query parameter city | |
val requiredQuery = Query.required("city") | |
// lens focusing on a required and non-empty string city | |
val nonEmptyQuery = Query.nonEmptyString().required("city") | |
// lens focusing on an optional header Content-Length with type int | |
val optionalHeader = Header.int().optional("Content-Length") | |
// lens focusing on text body | |
val responseBody = Body.string(ContentType.TEXT_PLAIN).toLens() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment