File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
src/main/groovy/com/github/hauner/openapi/spring/writer Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -37,13 +37,6 @@ class DataTypeWriter {
3737 target. write (" package ${ dataType.packageName} ;\n\n " )
3838
3939 List<String > imports = collectImports (dataType. packageName, dataType)
40- if (apiOptions. beanValidation){
41- for (DataType propDataType : dataType. properties. values ()) {
42- imports. addAll (beanValidationWriter. collectImports (propDataType))
43- }
44- }
45-
46- imports. sort ()
4740
4841 imports. each {
4942 target. write (" import ${ it} ;\n " )
@@ -93,16 +86,18 @@ class DataTypeWriter {
9386"""
9487 }
9588
96- List<String > collectImports (String packageName , DataType dataType ) {
89+ List<String > collectImports (String packageName , ObjectDataType dataType ) {
9790 Set<String > imports = []
9891 imports. add (' com.fasterxml.jackson.annotation.JsonProperty' )
9992
100- // if (apiOptions.beanValidation) {
101- // imports.addAll (beanValidationWriter.collectImports ());
102- // }
103-
10493 imports. addAll (dataType. referencedImports)
10594
95+ if (apiOptions. beanValidation){
96+ for (DataType propDataType : dataType. properties. values ()) {
97+ imports. addAll (beanValidationWriter. collectImports (propDataType))
98+ }
99+ }
100+
106101 new ImportFilter (). filter (packageName, imports)
107102 .sort ()
108103 }
You can’t perform that action at this time.
0 commit comments