プロジェクト

全般

プロフィール

Vote #68076

完了

xml used by rest API is invalid

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
REST API_32
対象バージョン:
開始日:
2010/09/09
期日:
進捗率:

0%

予定工数:
category_id:
32
version_id:
20
issue_org_id:
6345
author_id:
20195
assigned_to_id:
0
comments:
7
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
26
ステータス-->[Closed]

説明

The xml format used by REST API to insert a bug seem to be invalid. In forum page : http://www.redmine.org/boards/2/topics/17070 an example show the following :


1
1
test2
desc1gsdfgsdg

<1>test


Except that this XML code is invalid. Indeed:
http://www.w3.org/TR/2008/REC-xml-20081126/#NT-NameStartChar
specify that every node should start by a char within :

    NameStartChar      ::=      ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]

The result is that you cannot generate xml with DOM API. Currently, I use DOM but with a very bad workaround :

$aElem = $aXmlDoc->createElement("_TOREMOVE_1");
(...)
$aXmlOut = str_replace("_TOREMOVE_","",$aXmlDoc->saveXML($aRoot));

Can you try to fix it ?


journals

any update to this?
--------------------------------------------------------------------------------
Fixed in r4481. You can now use the piece of xml that the API returns to update custom fields:

<pre>
<custom_fields>
<custom_field id="1">
<value>Foo</value>
</custom_field>
...
</custom_fields>
</pre>
--------------------------------------------------------------------------------
If #6403 needed to be scheduled for 1.1.0, Shouldn't this issue be to 1.1.0 too?
--------------------------------------------------------------------------------
You're right. No feedback, I think it can wait 1.1.
--------------------------------------------------------------------------------
The Example is bad, good one :
<pre>
<custom_fields type="array">
<custom_field id="1">
<value>Foo</value>
</custom_field>
...
</custom_fields>
</pre>
--------------------------------------------------------------------------------
I just tried the following input

<pre>

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<issue>
<id>3273</id>
<subject>ch.elexis.base.ch.legacy.feature.feature.group</subject>
<description/>
<start_date>2014-08-20T00:00:00+02:00</start_date>
<project_id>0</project_id>
<tracker_id>0</tracker_id>
<custom_fields type="array">
<custom_field id="2" name="Abostatus">
<value>EXPIRED</value>
</custom_field>
</custom_fields>
<project id="3" name="Praxis Dr. Mustermann"/>
<tracker id="4" name="Service"/>
</issue>
</pre>

where the custom field is an enumeration, the value however is not updated to the provided EXPIRED.

This is Redmine 2.4.3.stable

--------------------------------------------------------------------------------
Marco Descher wrote:
> I just tried the following input
>
> [...]
>
> where the custom field is an enumeration, the value however is not updated to the provided EXPIRED.
>
> This is Redmine 2.4.3.stable

FTR:
#17760
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリREST API_32 にセット
  • 対象バージョン1.1.0_20 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0