File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
generators/src/main/java/com/algolia/codegen Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,21 @@ public class AlgoliaSwiftGenerator extends Swift5ClientCodegen {
147147 "widgets"
148148 );
149149
150+ private static final List <String > reservedModelNamesForCollections = List .of (
151+ "batchparams" ,
152+ "facethits" ,
153+ "gettaskresponse" ,
154+ "hit" ,
155+ "main" ,
156+ "multiplebatchrequest" ,
157+ "multiplebatchresponse" ,
158+ "searchforfacetvaluesrequest" ,
159+ "searchforfacetvaluesresponse" ,
160+ "searchhits" ,
161+ "searchresponse" ,
162+ "searchsource"
163+ );
164+
150165 // This is used for the CTS generation
151166 private static final AlgoliaSwiftGenerator INSTANCE = new AlgoliaSwiftGenerator ();
152167
@@ -161,7 +176,10 @@ public static String formatIdentifier(String text) {
161176 }
162177
163178 public static Boolean isReservedModelName (String name , String client ) {
164- return client .equalsIgnoreCase ("composition" ) || reservedModelNames .contains (name .toLowerCase ());
179+ return (
180+ reservedModelNames .contains (name .toLowerCase ()) ||
181+ (client .equalsIgnoreCase ("composition" ) && reservedModelNamesForCollections .contains (name .toLowerCase ()))
182+ );
165183 }
166184
167185 public static String prefixReservedModelName (String name , String client ) {
You can’t perform that action at this time.
0 commit comments