File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
restdocs-api-spec/src/main/kotlin/com/keecon/restdocs/apispec Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import org.springframework.http.MediaType.APPLICATION_JSON
8
8
import org.springframework.restdocs.RestDocumentationContext
9
9
import org.springframework.restdocs.generate.RestDocumentationGenerator.ATTRIBUTE_NAME_URL_TEMPLATE
10
10
import org.springframework.restdocs.operation.Operation
11
+ import org.springframework.restdocs.operation.OperationRequestPart
11
12
import org.springframework.restdocs.payload.FieldDescriptor
12
13
import org.springframework.restdocs.snippet.PlaceholderResolverFactory
13
14
import org.springframework.restdocs.snippet.RestDocumentationContextPlaceholderResolverFactory
@@ -46,7 +47,10 @@ class ResourceSnippet(private val resourceSnippetParameters: ResourceSnippetPara
46
47
val operationId =
47
48
propertyPlaceholderHelper.replacePlaceholders(operation.name, placeholderResolverFactory.create(context))
48
49
49
- val hasRequestBody = operation.request.contentAsString.isNotEmpty()
50
+ val hasRequestBody = operation.request.contentAsString.isNotEmpty() ||
51
+ operation.request.parts?.stream()
52
+ ?.map(OperationRequestPart ::getContentAsString)
53
+ ?.anyMatch { it.isNotEmpty() } ? : false
50
54
val hasResponseBody = operation.response.contentAsString.isNotEmpty()
51
55
52
56
val securityRequirements = SecurityRequirementsHandler ().extractSecurityRequirements(operation)
You can’t perform that action at this time.
0 commit comments