TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.05k stars 1.19k forks source link

[BUG] Nested json does not produce separate fields with the http api and MWS server #8370

Open andjar opened 4 months ago

andjar commented 4 months ago

Describe the bug

Using the PUT method for the http api, it seems that the MWS server struggles with nested json for fields. With the ordinary server, the following json produces a tiddler with three fields: a, c, e. The MWS server, however, seems to create two fields; a and fields where fields contains the full json {c": "d", e": "f"}

{
    "title": "HelloThere",
    "tags": "FirstTag [[Second Tag]]",
        "a": "b",
    "fields": {
        "c": "d",
                "e": "f"        
    }
}

Expected behavior

No response

To Reproduce

No response

Screenshots

No response

TiddlyWiki Configuration

Additional context

No response

Jermolene commented 3 months ago

Hi @andjar that nested JSON structure was introduced in TiddlyWeb where there was a distinction between the standard set of fields and custom fields. In retrospect, it was a bad idea as it meant that tiddlers needed to be transformed as they were sent and received from the server.

TW5 supported nested fields for compatibility with TiddlyWeb, but MWS will not support nested fields because TiddlyWeb is no longer relevant, and to keep things simple.