6
6
import io .swagger .models .auth .*;
7
7
import io .swagger .models .parameters .*;
8
8
import io .swagger .models .properties .ArrayProperty ;
9
+ import io .swagger .models .properties .BooleanValueProperty ;
9
10
import io .swagger .models .properties .Property ;
10
11
import io .swagger .models .properties .PropertyBuilder ;
11
12
import io .swagger .util .Json ;
@@ -769,6 +770,9 @@ public Model definition(ObjectNode node, String location, ParseResult result) {
769
770
result .missing (location , "empty schema" );
770
771
return null ;
771
772
}
773
+ if (node .isBoolean ()) {
774
+ return new BooleanValueModel (node .asBoolean ());
775
+ }
772
776
if (node .get ("$ref" ) != null ) {
773
777
return refModel (node , location , result );
774
778
}
@@ -804,7 +808,7 @@ public Model definition(ObjectNode node, String location, ParseResult result) {
804
808
am .setUniqueItems (uniqueItems );
805
809
}
806
810
807
- // add xml specific information if available
811
+ // add xml specific information if available
808
812
JsonNode xml = node .get ("xml" );
809
813
if (xml != null ) {
810
814
am .setXml (Json .mapper ().convertValue (xml , Xml .class ));
@@ -826,6 +830,8 @@ public Model definition(ObjectNode node, String location, ParseResult result) {
826
830
JsonNode ap = node .get ("additionalProperties" );
827
831
if (ap != null && ap .getNodeType ().equals (JsonNodeType .OBJECT )) {
828
832
impl .setAdditionalProperties (Json .mapper ().convertValue (ap , Property .class ));
833
+ } else if (ap != null && ap .isBoolean ()) {
834
+ impl .setAdditionalProperties (new BooleanValueProperty (ap .asBoolean ()));
829
835
}
830
836
831
837
value = getString ("default" , node , false , location , result );
@@ -1092,6 +1098,9 @@ public Map<String, Property> properties(ObjectNode node, String location, ParseR
1092
1098
1093
1099
public Property property (ObjectNode node , String location , ParseResult result ) {
1094
1100
if (node != null ) {
1101
+ if (node .isBoolean ()) {
1102
+ return new BooleanValueProperty (node .asBoolean ());
1103
+ }
1095
1104
if (node .get ("type" ) == null ) {
1096
1105
// may have an enum where type can be inferred
1097
1106
JsonNode enumNode = node .get ("enum" );
0 commit comments