-
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
base: main
Are you sure you want to change the base?
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?
@@ -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.
Followup of #4514, adding java client examples for the docs.
Out of 652 examples, 388 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 388 examples, 12 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.