This repository was archived by the owner on Mar 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
main/kotlin/io/openapiprocessor/core/converter/mapping
test/kotlin/io/openapiprocessor/core/converter/mapping Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,15 +131,14 @@ class MappingFinder(private val typeMappings: List<Mapping> = emptyList()) {
131131 /* *
132132 * get (global) result style option mapping value.
133133 *
134- * @return the [ResultStyle] if set, else the default value [ResultStyle.ALL]
134+ * @return the [ResultStyle] if set, otherwise null.
135135 */
136- fun findResultStyleMapping (): ResultStyle {
136+ fun findResultStyleMapping (): ResultStyle ? {
137137 val matches = typeMappings
138138 .filterIsInstance(ResultStyleOptionMapping ::class .java)
139139
140- // default
141140 if (matches.isEmpty())
142- return ResultStyle . SUCCESS
141+ return null
143142
144143 return matches.first().value
145144 }
Original file line number Diff line number Diff line change @@ -280,6 +280,14 @@ class MappingFinderSpec: StringSpec({
280280 result.targetTypeName.shouldBe("org.openapitools.jackson.nullable.JsonNullable ")
281281 }
282282
283+ " find unset result style option mapping" {
284+ val finder = MappingFinder (listOf())
285+
286+ val result = finder.findResultStyleMapping()
287+
288+ result.shouldBe(null)
289+ }
290+
283291 " find result style option mapping" {
284292 ResultStyle .values().forAll { style ->
285293 val finder = MappingFinder (listOf(ResultStyleOptionMapping (style)))
You can’t perform that action at this time.
0 commit comments