Skip to content

Commit 660bea5

Browse files
committed
rollback a bit
1 parent 04815d4 commit 660bea5

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

clients/algoliasearch-client-javascript/yarn.lock

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ __metadata:
139139
languageName: unknown
140140
linkType: soft
141141

142-
"@algolia/composition@npm:0.0.1, @algolia/composition@workspace:packages/composition":
142+
"@algolia/composition@workspace:packages/composition":
143143
version: 0.0.0-use.local
144144
resolution: "@algolia/composition@workspace:packages/composition"
145145
dependencies:
@@ -148,8 +148,8 @@ __metadata:
148148
"@algolia/requester-fetch": "npm:5.19.0"
149149
"@algolia/requester-node-http": "npm:5.19.0"
150150
"@arethetypeswrong/cli": "npm:0.17.3"
151-
"@types/node": "npm:22.10.5"
152-
publint: "npm:0.3.1"
151+
"@types/node": "npm:22.10.7"
152+
publint: "npm:0.3.2"
153153
rollup: "npm:4.30.1"
154154
tsup: "npm:8.3.5"
155155
typescript: "npm:5.7.3"
@@ -2317,7 +2317,6 @@ __metadata:
23172317
"@algolia/client-personalization": "npm:5.19.0"
23182318
"@algolia/client-query-suggestions": "npm:5.19.0"
23192319
"@algolia/client-search": "npm:5.19.0"
2320-
"@algolia/composition": "npm:0.0.1"
23212320
"@algolia/ingestion": "npm:1.19.0"
23222321
"@algolia/monitoring": "npm:1.19.0"
23232322
"@algolia/recommend": "npm:5.19.0"

generators/src/main/java/com/algolia/codegen/utils/GenericPropagator.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ private static boolean hasGeneric(IJsonSchemaValidationProperties property) {
5454
}
5555
return (
5656
(boolean) vendorExtensions.getOrDefault("x-propagated-generic", false) ||
57-
(boolean) vendorExtensions.getOrDefault("x-has-child-generic", false) ||
58-
(boolean) vendorExtensions.getOrDefault("x-is-generic", false)
57+
(boolean) vendorExtensions.getOrDefault("x-has-child-generic", false)
5958
);
6059
}
6160

@@ -80,13 +79,16 @@ private static boolean markPropagatedGeneric(
8079
}
8180
// if items itself isn't generic, we recurse on its items and properties until we reach the
8281
// end or find a generic property
83-
if (items != null && (hasGeneric(items) || markPropagatedGeneric(items, getVar, skipOneOf))) {
82+
if (
83+
items != null &&
84+
((boolean) items.vendorExtensions.getOrDefault("x-is-generic", false) || markPropagatedGeneric(items, getVar, skipOneOf))
85+
) {
8486
setPropagatedGeneric(model);
8587
return true;
8688
}
8789
for (CodegenProperty variable : getVar.apply(model)) {
8890
// same thing for the variable, if it's not a generic, we recurse on it until we find one
89-
if (hasGeneric(items) || markPropagatedGeneric(variable, getVar, skipOneOf)) {
91+
if ((boolean) variable.vendorExtensions.getOrDefault("x-is-generic", false) || markPropagatedGeneric(variable, getVar, skipOneOf)) {
9092
setPropagatedGeneric(model);
9193
return true;
9294
}
@@ -130,8 +132,7 @@ private static void setGenericToComposedSchema(
130132
return;
131133
}
132134
for (CodegenProperty prop : composedSchemas) {
133-
if (hasGeneric(prop) || hasGeneric(propertyToModel(models, prop))) {
134-
setHasChildGeneric(model);
135+
if (hasGeneric(propertyToModel(models, prop))) {
135136
setHasChildGeneric(prop);
136137
}
137138
}
@@ -208,7 +209,7 @@ public static void propagateGenericsToModels(Map<String, ModelsMap> modelsMap) {
208209
}
209210

210211
public static void propagateGenericsToModels(Map<String, ModelsMap> modelsMap, boolean skipOneOf) {
211-
propagateGenericsToModels("dontcare", "dontcare", modelsMap, false);
212+
propagateGenericsToModels("dontcare", "dontcare", modelsMap, skipOneOf);
212213
}
213214

214215
public static void propagateGenericsToModels(String language, String client, Map<String, ModelsMap> modelsMap) {

0 commit comments

Comments
 (0)