Skip to content

Integer Being Parsed to String #745

@JoshuaMarden

Description

@JoshuaMarden
  • Are you running the latest version?
  • Have you included sample input, output, error, and expected output?
  • Have you checked if you are using correct configuration?
  • Did you try online tool?
  • Have you checked the docs for helpful APIs and examples?

Description

XML with integer of 'nil' gets parsed to an empty string in JSON, rather than 0. Doesn't appear to be configurable.

Input

Drop this in the online parser for example:

<?xml version="1.0" encoding="UTF-8"?>
<data>
  <example-field type="integer" nil="true"/>
</data>

Code

N/A

Output

{
    "?xml": "",
    "data": {
        "example-field": ""
    }
}

expected data

{
    "?xml": "",
    "data": {
        "example-field": 0
    }
}

Would you like to work on this issue?

  • Yes
  • No

Bookmark this repository for further updates. Visit SoloThought to know about recent features.

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