Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

Commit 9ecf208

Browse files
committed
#45, has explicit null type
1 parent b802232 commit 9ecf208

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/main/kotlin/io/openapiprocessor/core/converter/mapping/MappingFinder.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,27 +188,27 @@ class MappingFinder(private val typeMappings: List<Mapping> = emptyList()) {
188188
* @param info schema info of the OpenAPI schema.
189189
* @return the "null" type mappings or null if there is no match.
190190
*/
191-
fun findEndpointNullTypeMapping(info: SchemaInfo): TypeMapping? {
191+
fun findEndpointNullTypeMapping(info: SchemaInfo): NullTypeMapping? {
192192
val ep = filterMappings(EndpointTypeMatcher(info.getPath()), typeMappings)
193193

194194
val matches = filterMappings(NullTypeMatcher(), ep)
195195
if (matches.isEmpty())
196196
return null
197197

198-
return matches.first() as TypeMapping
198+
return matches.first() as NullTypeMapping
199199
}
200200

201201
/**
202202
* find (global) "null" type mapping.
203203
*
204204
* @return the "multi" type mappings or null if there is no match.
205205
*/
206-
fun findNullTypeMapping(): TypeMapping? {
206+
fun findNullTypeMapping(): NullTypeMapping? {
207207
val matches = filterMappings(NullTypeMatcher(), typeMappings)
208208
if (matches.isEmpty())
209209
return null
210210

211-
return matches.first() as TypeMapping
211+
return matches.first() as NullTypeMapping
212212
}
213213

214214
private fun getTypeMapping(mappings: List<Mapping>): TypeMapping? {

src/main/kotlin/io/openapiprocessor/core/converter/mapping/matcher/NullTypeMatcher.kt

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

66
package io.openapiprocessor.core.converter.mapping.matcher
77

8-
import io.openapiprocessor.core.converter.mapping.TypeMapping
8+
import io.openapiprocessor.core.converter.mapping.NullTypeMapping
99

1010
/**
1111
* [io.openapiprocessor.core.converter.mapping.MappingFinder] matcher for null type mapping.
1212
*/
13-
class NullTypeMatcher: (TypeMapping) -> Boolean {
13+
class NullTypeMatcher: (NullTypeMapping) -> Boolean {
1414

15-
override fun invoke(mapping: TypeMapping): Boolean {
15+
override fun invoke(mapping: NullTypeMapping): Boolean {
1616
return mapping.sourceTypeName == "null"
1717
}
1818

0 commit comments

Comments
 (0)