From f53e6c701ffbde6d00f81831d31f7d8d8b358dbd Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 24 Aug 2018 17:08:29 +0200 Subject: [PATCH] Improve actuator documentation about the types supported for endpoints Closes gh-13896 --- .../asciidoc/production-ready-features.adoc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 560fac6f161..7a98ec3937e 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 @@ -532,6 +532,24 @@ JSON request body. When exposed via JMX, the parameters are mapped to the parame the MBean's operations. Parameters are required by default. They can be made optional by annotating them with `@org.springframework.lang.Nullable`. +Each root property in the JSON request body can be mapped to a parameter of the endpoint. +Consider the following JSON request body: + +[source,json,indent=0] +---- + { + "name": "test", + "counter": 42 + } +---- + +This can be used to invoke a write operation that takes a `String test` and `int counter` +parameters. + +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. + NOTE: To allow the input to be mapped to the operation method's parameters, Java code implementing an endpoint should be compiled with `-parameters`, and Kotlin code implementing an endpoint should be compiled with `-java-parameters`. This will happen