[MGNLRESTCL-160] DOC: Complex body objects Created: 07/May/20  Updated: 17/Jul/20  Resolved: 17/Jul/20

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

Type: Task Priority: Neutral
Reporter: Jorge Franco Assignee: Martin Drápela
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:
Epic Link: DOC: Documentation for Magnolia 6.2
Sprint: CM & OC 7
Story Points: 1

 Description   

Some client has problems using body with no string properties, take a look at https://jira.magnolia-cms.com/browse/HELPDESK-794

 

So I think we can add more information in documentation:

  • In the rest client app, you can only define parameters as strings
  • There is no way to define parameters as lists in yaml
  • You can specify the body in the yaml as a string and add there the parameters that are not a string

This is the way to send a list in a body:

restCalls:
  create:
    method: post
    entityClass: com.fasterxml.jackson.databind.JsonNode
    path: /createPost
    body: '{"userId": 1, "title": "aTitle", "list": {list}}'
    defaultValues:
      list: "[5]"

This is not supported:

restCalls:
  create:
    method: post
    entityClass: com.fasterxml.jackson.databind.JsonNode
    path: /createPost
    body: '{"userId": 1, "title": "aTitle", "list": {list}}'
    headers:
      Content-Type: "application/json; charset=UTF-8"
    defaultValues:
      list:
        - 5

Also this is not supported:

    body:
      userId: 1
      title: aTitle
      list:
        - 5
# Also this not working
    body: 
      list: "{list}" # or list: "[5]"


 Comments   
Comment by Martin Drápela [ 17/Jul/20 ]

Closing after "very nice! " rv by Jorge.

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