JSON url parameter


#1

The value for param2 below is JSON but the spec doesn’t support this.
So I’m wondering what would be the best way to handle a form parameter whose value is a complex type like JSON?

#%RAML 0.8
---
title: REST API
baseUri: https://localhost:8080/
/my-resource:
  displayName: resource
  description:
  post:
    description: post
    body:
      application/x-www-form-urlencoded:
        formParameters:
          param1:
            type: string
            example: some string
          param2:
            type: string
            example:
#                "{
#                  "field1": 1,
#                  "myMap": {
#                    "key1": "value1"
#                    "key2": "value2"
#                  }
#                }"

#2

you need a block scalar indicator (a pipe “|”) to be able to enter a multiline scalar value, also the surrounding quotes are not needed in this case:

example: |
    {
      "field1": 1,
      "myMap": {
        "key1": "value1"
        "key2": "value2"
      }
    }