-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(open-api-gateway): java support for router for using single lamb…
…da function for all operations (#242) Adds a HandlerRouter class to the generated Java client which can be extended and used as the lambda entrypoint for all operations. The router requires you to define a method which returns a handler for every operation. The router can also be decorated with interceptors to apply to all operations. fix #238
- Loading branch information
Showing
15 changed files
with
2,212 additions
and
300 deletions.
There are no files selected for viewing
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
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
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
19 changes: 19 additions & 0 deletions
19
packages/open-api-gateway/scripts/generators/java/templates/operations.mustache
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package {{package}}; | ||
|
||
{{>generatedAnnotation}} | ||
public class Operations { | ||
/** | ||
* Returns an OperationConfig Builder with all values populated with the given value. | ||
* You can override specific values on the builder if you like. | ||
* Make sure you call `.build()` at the end to construct the OperationConfig. | ||
*/ | ||
public static <T> OperationConfig.OperationConfigBuilder<T> all(final T value) { | ||
return OperationConfig.<T>builder() | ||
{{#operations}} | ||
{{#operation}} | ||
.{{nickname}}(value) | ||
{{/operation}} | ||
{{/operations}} | ||
; | ||
} | ||
} |
Oops, something went wrong.