Skip to content

Commit cdea586

Browse files
authored
Merge branch 'main' into fix/api-typos
2 parents fda3668 + 0fc6f86 commit cdea586

File tree

27 files changed

+485
-60
lines changed

27 files changed

+485
-60
lines changed

clients/algoliasearch-client-ruby/lib/algolia/api/monitoring_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ def get_reachability_with_http_info(clusters, request_options = {})
489489
# @return [Hash<String, Hash>]
490490
def get_reachability(clusters, request_options = {})
491491
response = get_reachability_with_http_info(clusters, request_options)
492-
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Monitoring::Hash<String, Hash>")
492+
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Hash<String, Hash>")
493493
end
494494

495495
# Retrieves the servers that belong to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application&#39;s cluster. - Without authentication, the response lists the servers for all Algolia clusters.

clients/algoliasearch-client-ruby/lib/algolia/api/search_client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,7 @@ def get_dictionary_languages_with_http_info(request_options = {})
12451245
# @return [Hash<String, Languages>]
12461246
def get_dictionary_languages(request_options = {})
12471247
response = get_dictionary_languages_with_http_info(request_options)
1248-
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Search::Hash<String, Languages>")
1248+
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Hash<String, Languages>")
12491249
end
12501250

12511251
# Retrieves the languages for which standard dictionary entries are turned off.
@@ -1400,7 +1400,7 @@ def get_object_with_http_info(index_name, object_id, attributes_to_retrieve = ni
14001400
# @return [Object]
14011401
def get_object(index_name, object_id, attributes_to_retrieve = nil, request_options = {})
14021402
response = get_object_with_http_info(index_name, object_id, attributes_to_retrieve, request_options)
1403-
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Search::Object")
1403+
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
14041404
end
14051405

14061406
# Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.

templates/ruby/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ module {{moduleName}}
225225
# @return [{{{returnType}}}{{^returnType}}nil{{/returnType}}]
226226
def {{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{^required}}{{paramName}}=nil, {{/required}}{{/allParams}}request_options = {})
227227
{{#returnType}}response = {{/returnType}}{{operationId}}_with_http_info({{#allParams}}{{paramName}}, {{/allParams}}request_options)
228-
{{#returnType}}@api_client.deserialize(response.body, request_options[:debug_return_type]{{#vendorExtensions}}{{#returnProperty}} || '{{#isArray}}Array<{{{modelModule}}}::{{complexType}}>{{/isArray}}{{^isArray}}{{^x-is-custom-request}}{{{modelModule}}}::{{/x-is-custom-request}}{{{dataType}}}{{/isArray}}'{{/returnProperty}}{{/vendorExtensions}}){{/returnType}}{{^returnType}}nil{{/returnType}}
228+
{{#returnType}}@api_client.deserialize(response.body, request_options[:debug_return_type]{{#vendorExtensions}}{{#returnProperty}} || '{{#isArray}}Array<{{{modelModule}}}::{{complexType}}>{{/isArray}}{{^isArray}}{{^isPrimitiveType}}{{^isMap}}{{{modelModule}}}::{{/isMap}}{{/isPrimitiveType}}{{{dataType}}}{{/isArray}}'{{/returnProperty}}{{/vendorExtensions}}){{/returnType}}{{^returnType}}nil{{/returnType}}
229229
end
230230
{{^-last}}
231231

tests/CTS/requests/search/getObject.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,29 @@
1515
"attributesToRetrieve": "attr1%2Cattr2"
1616
}
1717
}
18+
},
19+
{
20+
"testName": "search with a real object",
21+
"parameters": {
22+
"indexName": "cts_e2e_browse",
23+
"objectID": "Batman and Robin"
24+
},
25+
"request": {
26+
"path": "/1/indexes/cts_e2e_browse/Batman%20and%20Robin",
27+
"method": "GET"
28+
},
29+
"response": {
30+
"statusCode": 200,
31+
"body": {
32+
"objectID": "Batman and Robin",
33+
"title": "Batman and Robin",
34+
"year": 1949,
35+
"cast": [
36+
"Robert Lowery",
37+
"Johnny Duncan",
38+
"Jane Adams"
39+
]
40+
}
41+
}
1842
}
1943
]

tests/output/csharp/src/generated/e2e/Search.test.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,27 @@ public async Task BrowseTest()
6666
}
6767
}
6868

69+
[Fact(DisplayName = "search with a real object")]
70+
public async Task GetObjectTest1()
71+
{
72+
try
73+
{
74+
var resp = await client.GetObjectAsync("cts_e2e_browse", "Batman and Robin");
75+
// Check status code 200
76+
Assert.NotNull(resp);
77+
78+
JsonAssert.EqualOverrideDefault(
79+
"{\"objectID\":\"Batman and Robin\",\"title\":\"Batman and Robin\",\"year\":1949,\"cast\":[\"Robert Lowery\",\"Johnny Duncan\",\"Jane Adams\"]}",
80+
JsonSerializer.Serialize(resp, JsonConfig.Options),
81+
new JsonDiffConfig(true)
82+
);
83+
}
84+
catch (Exception e)
85+
{
86+
Assert.Fail("An exception was thrown: " + e.Message);
87+
}
88+
}
89+
6990
[Fact(DisplayName = "getRule")]
7091
public async Task GetRuleTest()
7192
{

tests/output/csharp/src/generated/requests/Search.test.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,17 @@ public async Task GetObjectTest()
12371237
}
12381238
}
12391239

1240+
[Fact(DisplayName = "search with a real object")]
1241+
public async Task GetObjectTest1()
1242+
{
1243+
await client.GetObjectAsync("cts_e2e_browse", "Batman and Robin");
1244+
1245+
var req = _echo.LastResponse;
1246+
Assert.Equal("/1/indexes/cts_e2e_browse/Batman%20and%20Robin", req.Path);
1247+
Assert.Equal("GET", req.Method.ToString());
1248+
Assert.Null(req.Body);
1249+
}
1250+
12401251
[Fact(DisplayName = "getObjects")]
12411252
public async Task GetObjectsTest()
12421253
{

tests/output/dart/test/requests/search_test.dart

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,28 @@ void main() {
14681468
),
14691469
);
14701470

1471+
// getObject
1472+
test(
1473+
'search with a real object',
1474+
() => runTest(
1475+
builder: (requester) => SearchClient(
1476+
appId: 'appId',
1477+
apiKey: 'apiKey',
1478+
options: ClientOptions(requester: requester),
1479+
),
1480+
call: (client) => client.getObject(
1481+
indexName: "cts_e2e_browse",
1482+
objectID: "Batman and Robin",
1483+
),
1484+
intercept: (request) {
1485+
expectPath(
1486+
request.path, '/1/indexes/cts_e2e_browse/Batman%20and%20Robin');
1487+
expect(request.method, 'get');
1488+
expect(request.body, null);
1489+
},
1490+
),
1491+
);
1492+
14711493
// getObjects
14721494
test(
14731495
'getObjects',

tests/output/go/tests/e2e/search_test.go

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/output/go/tests/requests/search_test.go

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/output/java/src/test/java/com/algolia/e2e/Search.test.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,21 @@ void browseTest() {
5050
);
5151
}
5252

53+
@Test
54+
@DisplayName("search with a real object")
55+
void getObjectTest1() {
56+
Object res = client.getObject("cts_e2e_browse", "Batman and Robin");
57+
assertDoesNotThrow(() ->
58+
JSONAssert.assertEquals(
59+
"{\"objectID\":\"Batman and Robin\",\"title\":\"Batman and" +
60+
" Robin\",\"year\":1949,\"cast\":[\"Robert Lowery\",\"Johnny Duncan\",\"Jane" +
61+
" Adams\"]}",
62+
json.writeValueAsString(res),
63+
JSONCompareMode.LENIENT
64+
)
65+
);
66+
}
67+
5368
@Test
5469
@DisplayName("getRule")
5570
void getRuleTest() {

0 commit comments

Comments
 (0)