Skip to content

Creating API objects from JSON data #302

Open
@assafcoh

Description

@assafcoh

Is your feature request related to a problem?

It is currently not possible to create API objects from JSON data.

What solution would you like?

For example we would like to do something like code below:

InputStream input = this.getClass()
    .getResourceAsStream("some-index.json"); 

CreateIndexRequest req = CreateIndexRequest.of(b -> b
    .index("some-index")
    .withJson(input) 
);

boolean created = client.indices().create(req).acknowledged();

What alternatives have you considered?

This withJson() method is currently supported on all API objects of the elasticsearch java client, and after moving to opensearch we feel this enhancement is greatly needed in opensearch java client too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions