File tree Expand file tree Collapse file tree
springfox-core/src/main/java/springfox/documentation/builders Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727import java .util .List ;
2828import java .util .Map ;
2929
30+ import static com .google .common .base .Strings .*;
3031import static com .google .common .collect .Lists .*;
3132import static com .google .common .collect .Maps .*;
3233import static springfox .documentation .builders .BuilderDefaults .*;
@@ -163,6 +164,9 @@ public ModelBuilder xml(Xml xml) {
163164 }
164165
165166 public Model build () {
167+ if (xml != null && isNullOrEmpty (xml .getName ())) {
168+ xml .setName (name );
169+ }
166170 return new Model (
167171 id ,
168172 name ,
Original file line number Diff line number Diff line change 2727
2828import java .util .List ;
2929
30+ import static com .google .common .base .Strings .*;
3031import static com .google .common .collect .Lists .*;
3132import static springfox .documentation .builders .BuilderDefaults .*;
3233
@@ -87,7 +88,7 @@ public ModelPropertyBuilder example(String example) {
8788 }
8889
8990 public ModelPropertyBuilder allowableValues (AllowableValues allowableValues ) {
90- this .allowableValues = emptyToNull (allowableValues , this .allowableValues );
91+ this .allowableValues = BuilderDefaults . emptyToNull (allowableValues , this .allowableValues );
9192 return this ;
9293 }
9394
@@ -117,6 +118,9 @@ public ModelPropertyBuilder xml(Xml xml) {
117118 }
118119
119120 public ModelProperty build () {
121+ if (xml != null && isNullOrEmpty (xml .getName ())) {
122+ xml .setName (name );
123+ }
120124 return new ModelProperty (
121125 name ,
122126 type ,
You can’t perform that action at this time.
0 commit comments