Skip to content

Commit

Permalink
improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
hauner committed Oct 2, 2024
1 parent 94ac14c commit a9a36b3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package io.openapiprocessor.core.converter.mapping

open class AnnotationNameMappingDefault(
open class AnnotationNameTypeMappingDefault(
/**
* The parameter name of this mapping. Must match 1:1 with what is written in the api.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class MappingConverter(val mapping: MappingV2) {
val (mapping, genericTypes) = parseMapping(source.name, source.generics)

return if (mapping.kind == ANNOTATE) {
AnnotationNameMappingDefault(mapping.sourceType!!, Annotation(
AnnotationNameTypeMappingDefault(mapping.sourceType!!, Annotation(
mapping.annotationType!!,
mapping.annotationParameters)
)
Expand Down Expand Up @@ -425,7 +425,7 @@ class MappingConverter(val mapping: MappingV2) {
throw BadMappingException(source.type)
}

return AnnotationNameMappingDefault(mapping.sourceType!!, Annotation(
return AnnotationNameTypeMappingDefault(mapping.sourceType!!, Annotation(
mapping.annotationType!!,
mapping.annotationParameters))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class AnnotationNameTypeMappingBuilder(val sourceTypeName: String) {
lateinit var type: String

fun annotation(): Mapping {
return AnnotationNameMappingDefault(
return AnnotationNameTypeMappingDefault(
sourceTypeName,
Annotation(type, linkedMapOf()))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,18 +489,18 @@ class DataTypeWriterPojoSpec: StringSpec({
options.extensionMappings = mapOf(
"x-foo" to ExtensionMappings(
mapOf("ext" to listOf(
AnnotationNameMappingDefault(
AnnotationNameTypeMappingDefault(
"ext", annotation = MappingAnnotation("annotation.Extension", linkedMapOf())
)))),

"x-bar" to ExtensionMappings(
mapOf(
"barA" to listOf(
AnnotationNameMappingDefault(
AnnotationNameTypeMappingDefault(
"barA", annotation = MappingAnnotation("annotation.BarA", linkedMapOf())
)),
"barB" to listOf(
AnnotationNameMappingDefault(
AnnotationNameTypeMappingDefault(
"barB", annotation = MappingAnnotation("annotation.BarB", linkedMapOf())
))
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import io.kotest.matchers.string.shouldStartWith
import io.openapiprocessor.core.converter.ApiOptions
import io.openapiprocessor.core.converter.JsonPropertyAnnotationMode
import io.openapiprocessor.core.converter.mapping.Annotation
import io.openapiprocessor.core.converter.mapping.AnnotationNameMappingDefault
import io.openapiprocessor.core.converter.mapping.AnnotationNameTypeMappingDefault
import io.openapiprocessor.core.converter.mapping.ExtensionMappings
import io.openapiprocessor.core.extractImports
import io.openapiprocessor.core.model.datatypes.*
Expand Down Expand Up @@ -313,18 +313,18 @@ class DataTypeWriterRecordSpec: StringSpec({
options.extensionMappings = mapOf(
"x-foo" to ExtensionMappings(
mapOf("ext" to listOf(
AnnotationNameMappingDefault(
AnnotationNameTypeMappingDefault(
"ext", annotation = Annotation("annotation.Extension", linkedMapOf())
)))),

"x-bar" to ExtensionMappings(
mapOf(
"barA" to listOf(
AnnotationNameMappingDefault(
AnnotationNameTypeMappingDefault(
"barA", annotation = Annotation("annotation.BarA", linkedMapOf())
)),
"barB" to listOf(
AnnotationNameMappingDefault(
AnnotationNameTypeMappingDefault(
"barB", annotation = Annotation("annotation.BarB", linkedMapOf())
))
))
Expand Down

0 comments on commit a9a36b3

Please sign in to comment.