Petals BC REST

Consumes mode optionnal get url parameters

Details

  • Type: Improvement Request Improvement Request
  • Status: New New
  • Resolution: Unresolved
  • Affects Version/s: 1.3.0-BC
  • Fix Version/s: None
  • Component/s: Consumer mode
  • Security Level: Public
  • Description:
    Hide

    Hello,

    I would like to be able to create a service with optional url parameters.

    The use of url parameters is possible but does not allow the optional character of the parameters.
    If I define my service as well

    <rest:operation name="adresse:RechercherAdresses">
    <rest:http-method>GET</rest:http-method>
    <rest:path-template>/</rest:path-template>
    <rest:http-body-type>none</rest:http-body-type>
    <rest:xml-template>
    <adresse:rechercher>
    <ligneAdresse>{texte}</ligneAdresse>
    <nomCommune>{commune}</nomCommune>
    <codePostal>{cp}</codePostal>
    <coorX>{x}</coorX>
    <coorY>{y}</coorY>
    <type>{type}</type>
    </adresse:rechercher>
    </rest:xml-template>


    With the following URL /?texte=xx&type=zz

    the result will be
    <adresse:rechercher>
    <ligneAdresse>xx</ligneAdresse>
    <nomCommune>{commune}</nomCommune>
    <codePostal>{cp}</codePostal>
    <coorX>{x}</coorX>
    <coorY>{y}</coorY>
    <type>zz</type>
    </adresse:rechercher>

    The goal is to have at least

    <adresse:rechercher>
    <ligneAdresse>xx</ligneAdresse>
    <nomCommune></nomCommune>
    <codePostal></codePostal>
    <coorX></coorX>
    <coorY></coorY>
    <type>zz</type>
    </adresse:rechercher>

    attached a diff to achieve this feature.

    Thank you

    Show
    Hello, I would like to be able to create a service with optional url parameters. The use of url parameters is possible but does not allow the optional character of the parameters. If I define my service as well <rest:operation name="adresse:RechercherAdresses"> <rest:http-method>GET</rest:http-method> <rest:path-template>/</rest:path-template> <rest:http-body-type>none</rest:http-body-type> <rest:xml-template> <adresse:rechercher> <ligneAdresse>{texte}</ligneAdresse> <nomCommune>{commune}</nomCommune> <codePostal>{cp}</codePostal> <coorX>{x}</coorX> <coorY>{y}</coorY> <type>{type}</type> </adresse:rechercher> </rest:xml-template> With the following URL /?texte=xx&type=zz the result will be <adresse:rechercher> <ligneAdresse>xx</ligneAdresse> <nomCommune>{commune}</nomCommune> <codePostal>{cp}</codePostal> <coorX>{x}</coorX> <coorY>{y}</coorY> <type>zz</type> </adresse:rechercher> The goal is to have at least <adresse:rechercher> <ligneAdresse>xx</ligneAdresse> <nomCommune></nomCommune> <codePostal></codePostal> <coorX></coorX> <coorY></coorY> <type>zz</type> </adresse:rechercher> attached a diff to achieve this feature. Thank you
  • Environment:
    windows 10 (WSL), debian
  1. bc_rest_add_get_optional_url_parameter.diff
    (2 kB)
    Guillaume Laplace
    Mon, 11 Mar 2019 - 10:09:56 +0100

Activity

Guillaume Laplace made changes - Mon, 11 Mar 2019 - 10:09:56 +0100
Field Original Value New Value
Attachment bc_rest_add_get_optional_url_parameter.diff [ 10810 ]

People

Dates

  • Created:
    Mon, 11 Mar 2019 - 10:07:44 +0100
    Updated:
    Mon, 11 Mar 2019 - 10:09:56 +0100