Hello, it's me again.

I can't actually find a way to transport a JSON as a request body except with a 
map, which obviously always has a json representation as well.

My current workaround for my code base is to convert the serialized form back 
into a map using xquery:eval.


let $requestBody := element { 'json' } {
    attribute { 'type' } { 'object' },
    element { 'the' } {
      attribute { 'type' } { 'object' },
      element { 'shit' } {
        attribute { 'type' } { 'object' },
        element { 'is' } {
          attribute { 'type' } { 'array' },
          element { '_' } {
            attribute { 'type' } { 'object' },
            element { 'on' } {
              attribute { 'type' } { 'object' },
              element { 'the' } {
                "steam"
              }
            }
          },
          element { '_' } {
            attribute { 'type' } { 'object' },
            element { 'what' } {
              attribute { 'type' } { 'object' },
              element { 'the' } {
                "f..."
              }
            }
          }
        }
      }
    }
  }
  return $requestBody => json:serialize() => xquery:eval()

Reply via email to