[MGNLRESTCL-155] Usage of RestClient has ability to customize request in an open manner Created: 09/Apr/20  Updated: 28/Jun/22

Status: Open
Project: REST Client
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Story Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Cloners
clones MGNLRESTCL-68 RestClient has ability to add query p... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Documentation update required:
Yes
Epic Link: RestClient Maintenance

 Description   

It must be possible to configure a RestClient in such a way that usages of the RestClient can customize a request by adding post body , headers and cookies .

Query parameters are handled by MGNLRESTCL-68.

User story

As a developer using a configured RestClient I want to be able to provide completely custom fragments, parameters, headers and cookies, so that I can hit the RestEndpoint in ways that the RestClient configurer could not predict, so I can use RestClients effectively and without too much hassel

Rationale

Some API's are very flexible and it would be difficult or impossible to configure all of the available options. It is a common usecase that a developer will configure a RestClient mostly to capture the basic connection information, but wants to leave it open to usages (such as freemarker templates) to use the RestClient as they see fit.

Example

Contentful Delivery API has very many query parameters. It would be a pain to configure them all:

https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters

Further, there are dynamic parameters, so whoever configures the restClient might not know all parametes ahead of time. (You can actually use one of your contentTypes attributes as a parameter.
https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters/ranges/query-entries/console/curl)

Details

Usage can provide additional values, but cannot change any values "hardcoded" in the RestClient definition.

For example, if you have two query params configured on your restCall as:
queryParams:
 category: destinations
 pageSize: ${pageSize}
I expect you can pass a different pageSize, and add new query parameters, but not override the category

To be determined:

Is a RestClient modifiable in this way by default, or what has to be configured in order to make it modifiable?


Generated at Mon Feb 12 10:43:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.