File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed
modules/swagger-codegen/src/main
java/io/swagger/codegen/languages Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
60
60
protected static final String LIBRARY_PROMISE_KIT = "PromiseKit" ;
61
61
protected static final String LIBRARY_RX_SWIFT = "RxSwift" ;
62
62
protected static final String [] RESPONSE_LIBRARIES = {LIBRARY_PROMISE_KIT , LIBRARY_RX_SWIFT };
63
+ protected static final String MODEL_CLASSES = "modelClasses" ;
63
64
protected String projectName = "SwaggerClient" ;
64
65
protected boolean unwrapRequired ;
65
66
protected boolean objcCompatible = false ;
@@ -302,6 +303,10 @@ public void processOpts() {
302
303
additionalProperties .put (POD_AUTHORS , DEFAULT_POD_AUTHORS );
303
304
}
304
305
306
+ if (additionalProperties .containsKey (MODEL_CLASSES )) {
307
+ additionalProperties .put ("useModelClasses" , true );
308
+ }
309
+
305
310
setLenientTypeCast (convertPropertyToBooleanAndWriteBack (LENIENT_TYPE_CAST ));
306
311
307
312
supportingFiles .add (new SupportingFile ("Podspec.mustache" ,
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ public class Swift5Codegen extends DefaultCodegen implements CodegenConfig {
47
47
private static final String LIBRARY_PROMISE_KIT = "PromiseKit" ;
48
48
private static final String LIBRARY_RX_SWIFT = "RxSwift" ;
49
49
private static final String [] RESPONSE_LIBRARIES = {LIBRARY_PROMISE_KIT , LIBRARY_RX_SWIFT };
50
+ protected static final String MODEL_CLASSES = "modelClasses" ;
50
51
protected String projectName = "SwaggerClient" ;
51
52
private boolean unwrapRequired ;
52
53
private boolean objcCompatible = false ;
@@ -289,6 +290,10 @@ public void processOpts() {
289
290
additionalProperties .put (POD_AUTHORS , DEFAULT_POD_AUTHORS );
290
291
}
291
292
293
+ if (additionalProperties .containsKey (MODEL_CLASSES )) {
294
+ additionalProperties .put ("useModelClasses" , true );
295
+ }
296
+
292
297
setLenientTypeCast (convertPropertyToBooleanAndWriteBack (LENIENT_TYPE_CAST ));
293
298
294
299
supportingFiles .add (new SupportingFile ("Podspec.mustache" ,
Original file line number Diff line number Diff line change 1
1
2
- public struct { {classname} }: Codable {
2
+ public { {#useModelClasses } }class { {/useModelClasses } } { {^useModelClasses } } struct{ {/useModelClasses } } { {classname} }: Codable {
3
3
4
4
{{#allVars} }
5
5
{ {#isEnum} }
Original file line number Diff line number Diff line change 1
1
2
- public struct { {classname} }: Codable {
2
+ public { {#useModelClasses } }class { {/useModelClasses } } { {^useModelClasses } } struct{ {/useModelClasses } } { {classname} }: Codable {
3
3
4
4
{{#allVars} }
5
5
{ {#isEnum} }
You can’t perform that action at this time.
0 commit comments