Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Why use JsonNode instead of String? #338

@zhuyuy

Description

@zhuyuy

I noticed that the arguments property in com.theokanning.openai.completion.chat.ChatFunctionCall class, which is supposed to be a serialized JSON string, is being represented as a JsonNode in the code. I would like to understand why JsonNode is chosen over directly using the String type. Since TextNode also stores a string, I'm not quite sure why String type wasn't used directly. What are the advantages of using JsonNode? I apologize for not considering its benefits earlier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions