Skip to content
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

Ensure PutMappingRequest.buildFromSimplifiedDef input are pairs #19837

Merged

Conversation

cbuescher
Copy link
Member

@cbuescher cbuescher commented Aug 5, 2016

The method expects pairs of fieldnames and property arguments and will fail if the varargs input is an uneven number. We should check this and fail with an appropriate IllegalArgumentException instead.

Relates to #19836

@jasontedor
Copy link
Member

LGTM. Thanks @cbuescher!

…t pairs

The method requires pairs of fieldnames and property arguments and will fail if
the varargs input is an uneven number. We should check this and fail with an
appropriate IllegalArgumentException instead.
@cbuescher cbuescher force-pushed the inputValidation-PutMappingRequest branch from 304a703 to e57f76a Compare August 5, 2016 17:25
@cbuescher cbuescher merged commit 37c433a into elastic:master Aug 5, 2016
@sfalquier
Copy link

It looks like documentation for 6.1 is not up to date : https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-admin-indices.html
... since PutMappingRequestBuilder.setSource(String source) is no longer available.

How should we build a PutMappingRequest from json source as String now?

@cbuescher
Copy link
Member Author

@sfalquier thanks for the note, I think you are right about the docs needing an update, can you create a separate issue please and include a short description of you what you think is missing?

The setSource(String source) method has been deprecated in #22691 (version 5.3) in favour of #setSource(String, XContentType). So with a json source you would probably want to use setSource("{ ... }", XContentType.JSON). Hope this helps.

@sfalquier
Copy link

Thanks!
I have just opened an issue here : #28131

@cbuescher cbuescher deleted the inputValidation-PutMappingRequest branch March 20, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants