File tree Expand file tree Collapse file tree
openapi-processor-core/src
main/kotlin/io/openapiprocessor/core/writer/java
test/kotlin/io/openapiprocessor/core/writer/java Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ abstract class DataTypeWriterBase(
324324 val target = getTarget(propData.propDataType)
325325
326326 if (requiresJsonPropertyAnnotation(propData)) {
327- imports.addAll(jacksonAnnotations.getJsonProperty() .imports)
327+ imports.addAll(jacksonAnnotations.jsonProperty .imports)
328328 }
329329
330330 if (apiOptions.beanValidation) {
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ import io.openapiprocessor.core.converter.ApiOptions
99import io.openapiprocessor.core.model.Annotation
1010
1111class JacksonAnnotations (apiOptions : ApiOptions ) {
12- private val jsonProperty: Annotation
13- private val jsonCreator: Annotation
14- private val jsonValue: Annotation
12+ val jsonProperty: Annotation
13+ val jsonCreator: Annotation
14+ val jsonValue: Annotation
1515
1616 init {
1717 when (getJacksonFormat(apiOptions)) {
@@ -28,10 +28,6 @@ class JacksonAnnotations(apiOptions: ApiOptions) {
2828 }
2929 }
3030
31- fun getJsonProperty (): Annotation = jsonProperty
32- fun getJsonCreator (): Annotation = jsonCreator
33- fun getJsonValue (): Annotation = jsonValue
34-
3531 private fun getJacksonFormat (options : ApiOptions ): JacksonFormat {
3632 return when (options.jackson) {
3733 " v2" -> JacksonFormat .V2
Original file line number Diff line number Diff line change @@ -102,8 +102,8 @@ open class StringEnumWriter(
102102
103103 private fun collectImports (packageName : String , dataType : DataType ): List <String > {
104104 val imports = mutableSetOf<String >()
105- imports.addAll(jacksonAnnotations.getJsonCreator() .imports)
106- imports.addAll(jacksonAnnotations.getJsonValue() .imports)
105+ imports.addAll(jacksonAnnotations.jsonCreator .imports)
106+ imports.addAll(jacksonAnnotations.jsonValue .imports)
107107 imports.addAll(generatedWriter.getImports())
108108 imports.addAll(dataType.referencedImports)
109109 if (isSupplier()) {
Original file line number Diff line number Diff line change @@ -881,7 +881,7 @@ class DataTypeWriterPojoSpec: StringSpec({
881881
882882 writer.write(target, dataType)
883883
884- verify { jackson.getJsonProperty() }
884+ verify { jackson.jsonProperty }
885885 }
886886
887887})
Original file line number Diff line number Diff line change @@ -587,7 +587,7 @@ class DataTypeWriterRecordSpec: StringSpec({
587587
588588 writer.write(target, dataType)
589589
590- verify { jackson.getJsonProperty() }
590+ verify { jackson.jsonProperty }
591591 }
592592})
593593
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ class JacksonAnnotationsSpec: StringSpec({
1717
1818 val jackson = JacksonAnnotations (options)
1919
20- jackson.getJsonProperty() .imports shouldContainExactly setOf("com.fasterxml.jackson.annotation.JsonProperty ")
21- jackson.getJsonCreator() .imports shouldContainExactly setOf("com.fasterxml.jackson.annotation.JsonCreator ")
22- jackson.getJsonValue() .imports shouldContainExactly setOf("com.fasterxml.jackson.annotation.JsonValue ")
20+ jackson.jsonProperty .imports shouldContainExactly setOf("com.fasterxml.jackson.annotation.JsonProperty ")
21+ jackson.jsonCreator .imports shouldContainExactly setOf("com.fasterxml.jackson.annotation.JsonCreator ")
22+ jackson.jsonValue .imports shouldContainExactly setOf("com.fasterxml.jackson.annotation.JsonValue ")
2323 }
2424
2525 " provides jackson 3 annotations" {
@@ -28,8 +28,8 @@ class JacksonAnnotationsSpec: StringSpec({
2828
2929 val jackson = JacksonAnnotations (options)
3030
31- jackson.getJsonProperty() .imports shouldContainExactly setOf("tools.jackson.annotation.JsonProperty ")
32- jackson.getJsonCreator() .imports shouldContainExactly setOf("tools.jackson.annotation.JsonCreator ")
33- jackson.getJsonValue() .imports shouldContainExactly setOf("tools.jackson.annotation.JsonValue ")
31+ jackson.jsonProperty .imports shouldContainExactly setOf("tools.jackson.annotation.JsonProperty ")
32+ jackson.jsonCreator .imports shouldContainExactly setOf("tools.jackson.annotation.JsonCreator ")
33+ jackson.jsonValue .imports shouldContainExactly setOf("tools.jackson.annotation.JsonValue ")
3434 }
3535})
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ class StringEnumWriterSpec : StringSpec({
3737
3838 writer.write(target, dataType)
3939
40- verify { jackson.getJsonCreator() }
41- verify { jackson.getJsonValue() }
40+ verify { jackson.jsonCreator }
41+ verify { jackson.jsonValue }
4242 }
4343})
You can’t perform that action at this time.
0 commit comments