Open owaiskazi19 opened 1 year ago
Please note #182. I think you could port XContent as is here.
Not sure if I'm misunderstanding something here, but I believe the equivalent here is to implement JsonpSerializable
on the document type or provide a explicit serializer to the builder? Used here which goes through to here. I realise this means rewriting your serializers and isn't drop-in ready, but I believe what you want to achieve is doable.
Not sure if I'm misunderstanding something here, but I believe the equivalent here is to implement
JsonpSerializable
on the document type or provide a explicit serializer to the builder? Used here which goes through to here. I realise this means rewriting your serializers and isn't drop-in ready, but I believe what you want to achieve is doable
This makes sense. Trying to understand the reason behind not supporting XContent
type here. Having the support will definitely help plugins to migrate from High Level Rest Client to Java Client without rewriting the serializers.
Is your feature request related to a problem?
For the purpose of creating extensions, we are migrating AnomalyDetector Plugin to AnomalyDetector Extension. The way High level rest client uses IndexRequest to index a document is:
It has
source
which requires a type XContentBuilder to parse the model object.Whereas Java Client uses IndexRequest in a builder model like:
It has
document
which requires a type TDocument. Parsing the model class AnomalyDetector creates the below response for IndexRequestThis is because of the JSON parsing instead of XContent in the java client.
Whereas high level rest client creates it like:
What solution would you like?
document
to parse JSON to XContentWhat alternatives have you considered?
A clear and concise description of any alternative solutions or features you've considered.
Do you have any additional context?
Mapping for the index can be find here. Request body is present here