-
Notifications
You must be signed in to change notification settings - Fork 102
add Java language examples #4580
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
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
1 similar comment
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
else { | ||
const alternative_java = []; | ||
alternative_java.push({ | ||
language: "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.
Should it be "Java", capitalized? This is exactly what the docs are going to show in the dropdown.
@@ -30975,6 +30975,66 @@ | |||
"summary": "Reindex multiple sources", | |||
"description": "Run `POST _reindex` to reindex from multiple sources. The `index` attribute in source can be a list, which enables you to copy from lots of sources in one request. This example copies documents from the `my-index-000001` and `my-index-000002` indices.\n", | |||
"value": "{\n \"source\": {\n \"index\": [\"my-index-000001\", \"my-index-000002\"]\n },\n \"dest\": {\n \"index\": \"my-new-index-000002\"\n }\n}" | |||
}, | |||
"ReindexRequestExample10": { |
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.
Why are all these new reindex examples part of this 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.
good catch, they have been recently removed, but I reintroduced them here due to rebasing, I'll delete them
@@ -25965,6 +25985,10 @@ | |||
{ | |||
"code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"user.id\":\"kimchy\"}},\"max_docs\":1}' \"$ELASTICSEARCH_URL/my-index-000001/_delete_by_query\"", | |||
"language": "curl" | |||
}, | |||
{ | |||
"code": "client.deleteByQuery(d -> d\n\t.index(\"my-index-000001\")\n\t.maxDocs(1L)\n\t.query(q -> q\n\t\t.term(t -> t\n\t\t\t.field(\"user.id\")\n\t\t\t.value(FieldValue.of(\"kimchy\"))\n\t\t)\n\t)\n);\n", |
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.
It looks like your code generator outputs tabs for indentation. I do not know how bump.sh interprets tabs when it renders code. I think it would be safer to produce spaces, if you can.
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 have left minor comments, but overall this looks good.
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
1 similar comment
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
1 similar comment
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-9.0 9.0
# Navigate to the new working tree
cd .worktrees/backport-9.0
# Create a new branch
git switch --create backport-4580-to-9.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c0bcce272173eeb249d1cde9b2a442bef3e75b79
# Push it to GitHub
git push --set-upstream origin backport-4580-to-9.0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-9.0 Then, create a pull request where the |
Followup of #4514, adding java client examples for the docs.
Out of 639 examples, 375 were generated by the java-request-converter, while the others are skipped for a number of reasons (APIs not supported by the client, unions the client cannot deserialize, classes that don't support json deserialization directly).
Out of those 375 examples, 11 had to be fixed manually (because of missing string escapes or missing/wrong brackets). I'm not 100% sure these will all compile, but in that case, changes should be minimal.
Unlike the other language examples, these won't be regenerated each time the openapi files are updated, since they rely on the experimental java-request-converter, so they will be generated locally when needed, using the new new
generate-language-examples-with-java
make command.