Skip to content

Commit 6c51057

Browse files
committed
improve typing
1 parent 5789000 commit 6c51057

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

openapi-processor-core-parser-api/src/main/kotlin/io/openapiprocessor/core/parser/Operation.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
package io.openapiprocessor.core.parser
77

8+
typealias HttpStatus = String
9+
810
/**
911
* OpenAPI Operation abstraction.
1012
*/
@@ -15,7 +17,7 @@ interface Operation {
1517
fun getParameters(): List<Parameter>
1618

1719
fun getRequestBody(): RequestBody?
18-
fun getResponses(): Map<String, Response>
20+
fun getResponses(): Map<HttpStatus, Response>
1921

2022
fun isDeprecated(): Boolean
2123
fun hasTags(): Boolean

openapi-processor-core-parser-api/src/main/kotlin/io/openapiprocessor/core/parser/Response.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55

66
package io.openapiprocessor.core.parser
77

8+
typealias ContentType = String
9+
810
/**
911
* OpenAPI Response abstraction.
1012
*/
1113
interface Response {
1214

13-
fun getContent(): Map<String, MediaType>
15+
fun getContent(): Map<ContentType, MediaType>
1416
val description: String?
1517

1618
}

0 commit comments

Comments
 (0)