-
Notifications
You must be signed in to change notification settings - Fork 21
fix(cts): gen for java #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for api-clients-automation canceled.
|
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
@@ -0,0 +1 @@ | |||
{{#isFreeFormObject}}<String, {{#value.0}}{{#oneOfModel}}{{classname}}{{/oneOfModel}}{{^oneOfModel}}{{objectName}}{{/oneOfModel}}{{> generateGenerics}}{{/value.0}}>{{/isFreeFormObject}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the missing newline are on purpose, to make the generate code tighter.
List<Pair> acutalQuery = req.getQueryParams(); | ||
for (Pair p : acutalQuery) { | ||
assertEquals(expectedQuery.get(p.getName()), p.getValue()); | ||
Map<String, String> expectedQuery = JSON.deserialize("{{#lambda.escapequotes}}{{{request.searchParams}}}{{/lambda.escapequotes}}", new TypeToken<HashMap<String, String>>() {}.getType()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct according to this ticket but will be fixed in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing to say! looks really good
@@ -355,13 +355,118 @@ runs: | |||
key: | | |||
${{ env.CACHE_VERSION }}-${{ | |||
hashFiles( | |||
'clients/algoliasearch-client-java-2/search/**', | |||
'clients/algoliasearch-client-java-2/api/SearchApi.java', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other solution is to leverage the modelPackage
, apiPackage
and invokerPackage
openapi-generator options so we only have one destination per client (...java-2/clientName
), not sure if it works but can make those paths easier to scope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anyway this is ought to change soon, those files are not pushed and should not be relevant to the cache, we cannot have any generated files in that list.
JSONAssert.assertEquals( | ||
"{\"indexName\":\"theIndexName\",\"sourceIndices\":[{\"indexName\":\"testIndex\",\"facets\":[{\"attributes\":\"test\"}],\"generate\":[[\"facetA\",\"facetB\"],[\"facetC\"]]}],\"languages\":[\"french\"],\"exclude\":[\"test\"]}", | ||
req.getBody(), | ||
JSONCompareMode.STRICT_ORDER | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I already asked but isn't it possible to have the unescaped version? D:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope not possible in java, the only way to write string is with double quote
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NICE
🧭 What and Why
Generate the CTS for all java clients.
Changes included:
🧪 Test
CI