From 1fd89dd724d6813f4c0616c6806332079ff05c13 Mon Sep 17 00:00:00 2001 From: lubos-cicut Date: Tue, 22 Aug 2023 07:32:19 +0200 Subject: [PATCH] Add description to POST requests MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Add description to POST request (paths/…/post/description) that states that user in example payload sees only the first data node child of the resource to be created and that this is in accordance with RFC 8040 which allows us to create only one resource in POST request. JIRA: NETCONF-1137 Change-Id: I8549cf860deb5e069a017c9e7247c0bce311e588 Signed-off-by: lubos-cicut Signed-off-by: Ivan Hrasko --- .../restconf/openapi/model/builder/OperationBuilder.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/restconf/restconf-openapi/src/main/java/org/opendaylight/restconf/openapi/model/builder/OperationBuilder.java b/restconf/restconf-openapi/src/main/java/org/opendaylight/restconf/openapi/model/builder/OperationBuilder.java index 5d6a620024..ddde629e33 100644 --- a/restconf/restconf-openapi/src/main/java/org/opendaylight/restconf/openapi/model/builder/OperationBuilder.java +++ b/restconf/restconf-openapi/src/main/java/org/opendaylight/restconf/openapi/model/builder/OperationBuilder.java @@ -46,6 +46,12 @@ public final class OperationBuilder { private static final List MIME_TYPES = List.of(MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON); private static final String OBJECT = "object"; private static final String TYPE_KEY = "type"; + private static final String POST_DESCRIPTION = """ + \n + Note: + In example payload, you can see only the first data node child of the resource to be created, following the + guidelines of RFC 8040, which allows us to create only one resource in POST request. + """; private OperationBuilder() { // Hidden on purpose @@ -78,7 +84,7 @@ public final class OperationBuilder { .parameters(parameters) .requestBody(requestBody) .responses(responses) - .description(description) + .description(description + POST_DESCRIPTION) .summary(summary) .build(); } -- 2.36.6