Skip to content

bug(parser): numeric/bool values from egg Configuration Files are written as strings #213

Description

@BlockMrTii

Problem

When an egg has a Configuration Files entry that sets a numeric (or boolean) value, e.g.:

{
    "bukkit.yml": {
        "parser": "yaml",
        "find": {
            "spawn-limits.monsters": 15
        }
    }
}

15 is defined as an integer in the egg, not a string. However, when the server is created and bukkit.yml is generated, the value is written as a quoted string instead:

spawn-limits:
  monsters: "15"   # actual
  monsters: 15      # expected

This causes issues with servers that expect a real number (or boolean) for these keys, since they receive a string instead.

Reproduction

  1. Use an egg with a Configuration Files entry that sets an integer or boolean value (e.g. spawn-limits.monsters: 15)
  2. Create a new server so the target file (bukkit.yml) is generated for the first time
  3. Result: monsters: "15" is written instead of monsters: 15

Expected behavior

Values defined as numbers/booleans in the egg's configs should be written unquoted in the resulting config file.

Additional context

Possibly related to open PR #194.

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