Getting started w/ RAML - Can't find source of validation error


#1

I’m just getting started with RAML, JSON Specification, and MuleSoft’s API Designer. I cannot get my “hello world” RAML to validate inside of API Designer’s editor. I’ve exhausted all obvious permutations and I cannot figure out what is wrong with it. The current error is ‘cannot find expected :’

#%RAML 0.8
version: 1
title: VPI
/elements:
  get:
    responses:    
      200:
        body:
          application/json:
            schema: |
          {
            "$schema": "http://json-schema.org/draft-03/schema",
            "properties": {
                "input": {
                    "required": false,
                    "type": "string"
                }
            },
            "required": false,
            "type": "object"
          }

#2

Hi @aaron,

Just an indentation error - you’ve got to indent the actual JSON schema so it is hierarchically within the schema field. See below!

#%RAML 0.8
version: 1
title: VPI
/elements:
  get:
    responses:    
      200:
        body:
          application/json:
            schema: |
              {
                "$schema": "http://json-schema.org/draft-03/schema",
                "properties": {
                    "input": {
                        "required": false,
                        "type": "string"
                    }
                },
                "required": false,
                "type": "object"
              }  

#3

Thank you. There was a third technologies I needed to learn: YAML.