From e8de069e00b2d887bdd5d28e21b3fe1d6ece1798 Mon Sep 17 00:00:00 2001 From: Ivo Smid Date: Thu, 20 Aug 2020 20:18:53 +0200 Subject: [PATCH] Add example of custom Actuator operations See gh-23028 --- .../src/main/asciidoc/production-ready-features.adoc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index d838974353..86166dc432 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -475,7 +475,15 @@ Consider the following JSON request body: } ---- -This can be used to invoke a write operation that takes `String name` and `int counter` parameters. +This can be used to invoke a write operation that takes `String name` and `int counter` parameters (name of Java parameter have to match name of JSON property). + +[source,java,indent=0] +---- + @WriteOperation + public void writeMethod(String name, int counter) { + // do the stuff + } +---- TIP: Because endpoints are technology agnostic, only simple types can be specified in the method signature. In particular declaring a single parameter with a custom type defining a `name` and `counter` properties is not supported.