In 6.0.0: How to consume rest-service that has reserved word id as parameter?

0
Trying to consume http://geodata.nationaalgeoregister.nl/locatieserver/v3/lookup?id=adr-d5f9140115706b3c755a928b77be1e02 Problem is: I have to set their obligatory parameter 'id' in my query, but I can not do so because in 6.0.1 you need to define a domain model having an attribute with that particular parameter name. But since 'id' is a reserved word, the Mendix Modeler does not allow you to do so. Don't see any solution on https://docs.mendix.com/howto6/consume-a-rest-service as well. How to solve/workaround this?    
asked
2 answers
5

Hi Tim,

 

If you create an attribute called _id in your entity it'll get matched to id.

 

See the documentation here:

https://github.com/mendix/restservices#matching-attibute-names

 

Any reserved name is accessible by using _ before the name.

answered
1

I have this problem in two places. See the domainmodel.

The first place is the request-url which has 'id' as parameter and the Java requestwidget should create that from QueryId-_id.

The second is the Response received that contains a field named 'docs-id'. For the second problem the '_' prefixing in DocObject-_id works. Thanks for that.

For the first problem it did not convert _id to id (at least not today), so I worked around that by creating the url in separate action and setting the optRequestData to empty.

answered