cosmocode / dokuwiki-plugin-struct

A new structured data plugin
https://www.dokuwiki.org/plugin:struct
GNU General Public License v2.0
40 stars 40 forks source link

XML-RPC API does not accept valid JSON arrays #520

Open psy-q opened 4 years ago

psy-q commented 4 years ago

When using plugin.struct.saveData via XML-RPC, the following does not work when using a lookup for the field "besitzer":

<member>
  <name>besitzer</name>
  <value>
    <string>["", 2]</string>
  </value>
</member>

Even though it's valid JSON. The ["", 2] part comes from the official Python JSON module. When trying to save data this way, any of the lookup data will simply appear as blank on the page since the Struct plugin doesn't seem to find the related records.

Instead, this works:

<member>
  <name>besitzer</name>
  <value>
    <string>["",2]</string>
  </value>
</member>

Note the lack of space between "", and 2. The JSON RFC allows spaces before and after structural characters, so I'm guessing the Python JSON module is in spec and the Struct plugin should accept this as well?

annda commented 4 years ago

@psy-q Can you please post the whole POST request body to make debugging this issue easier?