File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -517,10 +517,10 @@ public String apiFileFolder() {
517517
518518 @ Override
519519 public String getTypeDeclaration (Schema p ) {
520- if (ModelUtils .isArraySchema (p )) {
520+ if (ModelUtils .isArraySchema (p )) {
521521 ArraySchema ap = (ArraySchema ) p ;
522522 Schema inner = ap .getItems ();
523- return "[" + getTypeDeclaration (inner ) + "]" ;
523+ return ModelUtils . isSet ( p ) ? "Set<" + getTypeDeclaration ( inner ) + ">" : "[" + getTypeDeclaration (inner ) + "]" ;
524524 } else if (ModelUtils .isMapSchema (p )) {
525525 Schema inner = getAdditionalProperties (p );
526526 return "[String:" + getTypeDeclaration (inner ) + "]" ;
@@ -634,12 +634,12 @@ public String toDefaultValue(Schema p) {
634634
635635 @ Override
636636 public String toInstantiationType (Schema p ) {
637- if (ModelUtils .isMapSchema (p )) {
637+ if (ModelUtils .isMapSchema (p )) {
638638 return getSchemaType (getAdditionalProperties (p ));
639639 } else if (ModelUtils .isArraySchema (p )) {
640640 ArraySchema ap = (ArraySchema ) p ;
641641 String inner = getSchemaType (ap .getItems ());
642- return "[" + inner + "]" ;
642+ return ModelUtils . isSet ( p ) ? "Set<" + inner + ">" : "[" + inner + "]" ;
643643 }
644644 return null ;
645645 }
You can’t perform that action at this time.
0 commit comments