Petals BC REST

Unable to create a Rest request with the same form-data several times

Details

  • Type: Improvement Request Improvement Request
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.2.3-BC
  • Fix Version/s: 2.3.0-BC
  • Component/s: Provider mode
  • Security Level: Public
  • Description:
    Hide

    Unable to generate REST request with the same form data several times, as following:

    curl -u $PASTELL_LOGIN:$PASTELL_PASSWORD $PASTELL_SITE/api/v2/entite/1/document/XGfvh1v/externalData/type_piece -d'type_pj[]=99_AI' -d'type_pj[]=99_AU' -d'type_pj[]=41_NC' -X PATCH

    We should be able to use a form-data as array.

    Show
    Unable to generate REST request with the same form data several times, as following: curl -u $PASTELL_LOGIN:$PASTELL_PASSWORD $PASTELL_SITE/api/v2/entite/1/document/XGfvh1v/externalData/type_piece -d'type_pj[]=99_AI' -d'type_pj[]=99_AU' -d'type_pj[]=41_NC' -X PATCH We should be able to use a form-data as array.
  • Environment:
    -

Activity

Hide
Christophe DENEUX added a comment - Fri, 19 Nov 2021 - 11:04:19 +0100

Nowadays, the form-datas of outgoing REST request are defined as following:

<rest:operation name="toto">
    ...

    <rest:form-data name="dummy[]">
        <rest:extracted-by-xpath>//*[local-name()='dummy']</rest:extracted-by-xpath>
    </rest:form-data>

    ..
</rest:operation>

The result of the XPath expression is expected to be a simple value. If we are able to manage a result as array, we can create several form datas with the same name and different values.

Show
Christophe DENEUX added a comment - Fri, 19 Nov 2021 - 11:04:19 +0100 Nowadays, the form-datas of outgoing REST request are defined as following:
<rest:operation name="toto">
    ...

    <rest:form-data name="dummy[]">
        <rest:extracted-by-xpath>//*[local-name()='dummy']</rest:extracted-by-xpath>
    </rest:form-data>

    ..
</rest:operation>
The result of the XPath expression is expected to be a simple value. If we are able to manage a result as array, we can create several form datas with the same name and different values.
Hide
Christophe DENEUX added a comment - Fri, 19 Nov 2021 - 11:07:50 +0100

Done in branch 1.3.x with svn#43800

Show
Christophe DENEUX added a comment - Fri, 19 Nov 2021 - 11:07:50 +0100 Done in branch 1.3.x with svn#43800
Hide
Christophe DENEUX added a comment - Fri, 19 Nov 2021 - 11:08:09 +0100

Reopened to be merged in trunk

Show
Christophe DENEUX added a comment - Fri, 19 Nov 2021 - 11:08:09 +0100 Reopened to be merged in trunk
Hide
Christophe DENEUX added a comment - Fri, 19 Nov 2021 - 11:08:20 +0100

Merged in trunk

Show
Christophe DENEUX added a comment - Fri, 19 Nov 2021 - 11:08:20 +0100 Merged in trunk

People

Dates

  • Created:
    Fri, 19 Nov 2021 - 10:48:47 +0100
    Updated:
    Fri, 19 Nov 2021 - 11:08:20 +0100
    Resolved:
    Fri, 19 Nov 2021 - 11:08:20 +0100