Uploaded image for project: 'REST Client'
  1. REST Client
  2. MGNLRESTCL-160

DOC: Complex body objects

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Neutral
    • None
    • None
    • None
    • None

    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]"

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              mdrapela Martin Drápela
              jfranco Jorge Franco
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Task DoR