File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
modules/swagger-codegen/src/main/java/io/swagger/codegen Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -492,10 +492,16 @@ public String getSwaggerType(Property p) {
492
492
} else if (p instanceof DecimalProperty ) {
493
493
datatype = "number" ;
494
494
} else if (p instanceof RefProperty ) {
495
- RefProperty r = (RefProperty ) p ;
496
- datatype = r .get$ref ();
497
- if (datatype .indexOf ("#/definitions/" ) == 0 ) {
498
- datatype = datatype .substring ("#/definitions/" .length ());
495
+ try {
496
+ RefProperty r = (RefProperty ) p ;
497
+ datatype = r .get$ref ();
498
+ if (datatype .indexOf ("#/definitions/" ) == 0 ) {
499
+ datatype = datatype .substring ("#/definitions/" .length ());
500
+ }
501
+ } catch (Exception e ) {
502
+ LOGGER .warn ("Error obtaining the datatype from RefProperty:" + p + ". Datatype default to Object" );
503
+ datatype = "Object" ;
504
+ e .printStackTrace ();
499
505
}
500
506
} else {
501
507
if (p != null ) {
You can’t perform that action at this time.
0 commit comments