This repository was archived by the owner on Mar 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
main/kotlin/io/openapiprocessor/core/model
test/groovy/com/github/hauner/openapi/core/model Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -60,19 +60,18 @@ class Endpoint(
6060 }
6161
6262 /* *
63- * provides a list of all consumed content types of this endpoint including multipart/form-data.
63+ * provides a set of all consumed content types of this endpoint including multipart/form-data.
6464 *
6565 * multipart/form-data is special because a multipart request body with multiple properties is
6666 * converted to multiple {@link MultipartParameter}s in the internal model. The request body
6767 * information is no longer available.
6868 *
69- * @return the list of content types
69+ * @return the set of content types
7070 */
71- fun getConsumesContentTypes (): List <String > {
71+ fun getConsumesContentTypes (): Set <String > {
7272 val contentTypes = requestBodies
7373 .map { it.contentType }
74- .toSet()
75- .toMutableList()
74+ .toMutableSet()
7675
7776 val multipart = parameters.find {
7877 it is MultipartParameter
Original file line number Diff line number Diff line change @@ -22,10 +22,10 @@ class EndpointContentTypesSpec extends Specification {
2222 }
2323
2424 expect :
25- endpoint. consumesContentTypes == []
25+ endpoint. consumesContentTypes == [] as Set
2626 }
2727
28- void " provides consuming content types" () {
28+ void " provides distinct consuming content types" () {
2929 def endpoint = endpoint(' /foo' , HttpMethod . GET ) { e ->
3030 e. parameters () { ps ->
3131 ps. body(" body" , " text/plain" , new StringDataType ())
@@ -56,7 +56,7 @@ class EndpointContentTypesSpec extends Specification {
5656 }
5757
5858 expect :
59- endpoint. consumesContentTypes == [' multipart/form-data' ]
59+ endpoint. consumesContentTypes == [' multipart/form-data' ] as Set
6060 }
6161
6262 void " provides no producing content types without response" () {
You can’t perform that action at this time.
0 commit comments