Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
This repository was archived by the owner on Nov 18, 2021. It is now read-only.

Do not use "$" for text nodes #20

@hstaudacher

Description

@hstaudacher

When you want to get the text node of an element you can use the @SerializedName( "$" ) annotation which is pretty nice. Anyway, there are some problems with the "$".

Converting xml to objects works fine with this approach. But if you want to do a serialization back as json with plain Gson you may ran into problems. The field gets serialized with the name "$" because Gson also respects the @SerializedName annotation. This causes huge problems if you want to store the serialized object into databases e.g. MongoDB forbids to start keys with "$".

So, replacing the "$" would break API and is not an option I think. But would it be possible to make it configurable? By taking a first look at the code this should be doable, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions