Skip to content

Commit

Permalink
Merge branch 'main' into chore/less-needs
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Apr 28, 2022
2 parents 663a97d + 05ef8a9 commit efb1378
Show file tree
Hide file tree
Showing 67 changed files with 1,177 additions and 507 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ clients/algoliasearch-client-javascript/packages/*/.openapi-generator-ignore
tests/output/*/.openapi-generator-ignore

generators/bin
*.doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private static List<StatefulHost> getDefaultHosts() {
List<StatefulHost> hosts = new ArrayList<StatefulHost>();
hosts.add(
new StatefulHost(
"predict-api-oslcbws3zq-ew.a.run.app",
"predict-api-432xa6wemq-ew.a.run.app",
"https",
EnumSet.of(CallType.READ, CallType.WRITE)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2604,7 +2604,8 @@ private Call getDictionarySettingsValidateBeforeCall(
}

/**
* Retrieve dictionaries settings.
* Retrieve dictionaries settings. The API stores languages whose standard entries are disabled.
* Fetch settings does not return false values.
*
* @return GetDictionarySettingsResponse
* @throws AlgoliaRuntimeException If fail to call the API, e.g. server error or cannot
Expand All @@ -2627,7 +2628,8 @@ public GetDictionarySettingsResponse getDictionarySettings()
}

/**
* (asynchronously) Retrieve dictionaries settings.
* (asynchronously) Retrieve dictionaries settings. The API stores languages whose standard
* entries are disabled. Fetch settings does not return false values.
*
* @param callback The callback to be executed when the API call finishes
* @return The request call
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const apiClientVersion = '0.0.5';
function getDefaultHosts(): Host[] {
return [
{
url: 'predict-api-oslcbws3zq-ew.a.run.app',
url: 'predict-api-432xa6wemq-ew.a.run.app',
accept: 'readWrite',
protocol: 'https',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1161,9 +1161,9 @@ export function createSearchClient(options: CreateClientOptions) {
},

/**
* Retrieve dictionaries settings.
* Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values.
*
* @summary Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values.
* @summary Retrieve dictionaries settings.
*/
getDictionarySettings(
requestOptions?: RequestOptions
Expand Down
4 changes: 2 additions & 2 deletions clients/algoliasearch-client-php/lib/Api/SearchClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ public function clearAllSynonyms($indexName, $forwardToReplicas = null)
}

/**
* clear all objects from an index.
* Clear all objects from an index.
*
* @param string $indexName The index in which to perform the request. (required)
*
Expand Down Expand Up @@ -1276,7 +1276,7 @@ public function getDictionaryLanguages()
}

/**
* Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values.
* Retrieve dictionaries settings.
*
*
* @return array<string, mixed>|\Algolia\AlgoliaSearch\Model\Search\GetDictionarySettingsResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.io.IOException;
import java.util.*;
import java.util.Map.Entry;
import java.util.TreeMap;
import org.openapitools.codegen.*;

@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -146,20 +147,20 @@ public Map<String, Object> postProcessSupportingFileData(
language
);

for (Entry<String, Request[]> entry : cts.entrySet()) {
for (Entry<String, CodegenOperation> entry : operations.entrySet()) {
String operationId = entry.getKey();
if (!operations.containsKey(operationId)) {
if (!cts.containsKey(operationId)) {
throw new CTSException(
"operationId " + operationId + " does not exist in the spec"
);
}
CodegenOperation op = operations.get(operationId);
Request[] op = cts.get(operationId);

List<Object> tests = new ArrayList<>();
for (int i = 0; i < entry.getValue().length; i++) {
for (int i = 0; i < op.length; i++) {
Map<String, Object> test = paramsType.buildJSONForRequest(
entry.getValue()[i],
op,
op[i],
entry.getValue(),
i
);
tests.add(test);
Expand Down Expand Up @@ -190,7 +191,18 @@ public Map<String, Object> postProcessSupportingFileData(
private Map<String, Request[]> loadCTS()
throws JsonParseException, JsonMappingException, IOException, CTSException {
TreeMap<String, Request[]> cts = new TreeMap<>();
File dir = new File("tests/CTS/methods/requests/" + client);
String clientName = client;

// This special case allow us to read the `search` CTS to generated the
// tests for the `algoliasearch-lite` client, which is only available
// in JavaScript
if (
language.equals("javascript") && clientName.equals("algoliasearch-lite")
) {
clientName = "search";
}

File dir = new File("tests/CTS/methods/requests/" + clientName);
File commonTestDir = new File("tests/CTS/methods/requests/common");
if (!dir.exists()) {
throw new CTSException("CTS not found at " + dir.getAbsolutePath(), true);
Expand All @@ -217,28 +229,32 @@ private Map<String, Request[]> loadCTS()
}

// operationId -> CodegenOperation
private HashMap<String, CodegenOperation> buildOperations(
private TreeMap<String, CodegenOperation> buildOperations(
Map<String, Object> objs
) {
HashMap<String, CodegenOperation> result = new HashMap<>();
List<Map<String, Object>> apis =
((Map<String, List<Map<String, Object>>>) objs.get("apiInfo")).get(
"apis"
);

for (Map<String, Object> api : apis) {
String apiName = ((String) api.get("baseName")).toLowerCase();
if (!apiName.equals(client.replace("-", ""))) {
continue;
}

List<CodegenOperation> operations =
((Map<String, List<CodegenOperation>>) api.get("operations")).get(
"operation"
);

for (CodegenOperation ope : operations) {
result.put(ope.operationId, ope);
}
}
return result;

return new TreeMap<String, CodegenOperation>(result);
}

private String createImportName() {
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build]
command="yarn website:build"
command="BUNDLE_WITH_DOC=true DOCKER=true yarn cli build specs all && yarn website:build"
publish="website/build"
ignore="git diff --quiet $COMMIT_REF $CACHED_COMMIT_REF -- website/"

Expand Down
Loading

0 comments on commit efb1378

Please sign in to comment.