Invalid JSON format of fabric.mod.json
Stefan99353 opened this issue ยท 1 comments
I just encountered a problem while parsing this mods fabric.mod.json
file.
The description
field is a multi-line string when extracting the jar file.
As far as I know, this is not valid JSON:
{
"schemaVersion": 1,
"id": "fallingleaves",
"version": "1.12.1+1.19",
"name": "Falling Leaves",
"description": "\"How the gentle wind
beckons through the leaves
as autumn colors fall,
dancing in a swirl
of golden memories:
the loveliest lies of all.\"",
"authors": [
"Fourmisain",
"BrekiTomasson",
"RandomMcSomethin"
],
"contact": {
"homepage": "https://www.curseforge.com/minecraft/mc-mods/falling-leaves-fabric",
"issues": "https://github.com/RandomMcSomethin/fallingleaves/issues",
"sources": "https://github.com/RandomMcSomethin/fallingleaves"
},
"license": "MIT",
"icon": "assets/fallingleaves/icon.png",
"environment": "client",
"entrypoints": {
"client": [
"randommcsomethin.fallingleaves.FallingLeavesClient"
],
"modmenu": [
"randommcsomethin.fallingleaves.config.gui.FallingLeavesMenu"
]
},
"mixins": [
"fallingleaves.mixins.json"
],
"depends": {
"fabricloader": ">=0.14.6",
"fabric": "*",
"minecraft": ">=1.19.0",
"cloth-config2": ">=6.0.0",
"java": ">=17"
}
}
I inspected the source code and found that those line-breaks are not there. They are represented using \n
characters.
Is this an error during build or is it meant to be like that?
It's the the copy task's expand
that does it, luckily this has already been reported as an issue and an escapeBackslash
setting was added in Gradle 7.2 so it's a really easy fix.
I wanted to do new release for a while now, so this is a good point for a patch release.