Skip to content

[Feat]: I want to pass a JSON string to DataPart #753

@jmesnil

Description

@jmesnil

Is your feature request related to a problem? Please describe.

The DataPart constructors requires to pass Java collections (Map, List) but it does not accept a Java string that contains a JSON payload.
This would simplify the user experience to have it otherwise, it forces the user to "serialise" a JSON string into a Java collection to be able to pass it to the DataPart.

Describe the solution you'd like

A new DataPart construction DataPart(String json, @nullable Map<String, Object> metadata) that can be called with:

        DataPart dataPart = new DataPart("""
        {
            "temperature": 22.5,
            "humidity": 65
        }""");

Describe alternatives you've considered

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions