joev
joev

Reputation: 105

AWS API Gateway Model : Invalid model schema specified

I am getting error while creating Model in aws api gateway, Json is in correct format and still it says validation error. Please anyone? where I went wrong?

Error message "Invalid model specified: Validation Result: warnings : [], errors : [Invalid model schema specified]"

Json Schema i am trying to use is:

{
   "action":"createOrUpdate",
   "Content-Type":"application/json",
   "accept":"application/json",
   "input":[
      {
         "utm_CustomObj":"19UYA31581L000000",
         "leadId":"1071319"
      }
   ]
}

Error screen shot

Upvotes: 8

Views: 31539

Answers (3)

Joshua Dixon
Joshua Dixon

Reputation: 20

Apache Velocity Template Language is the language of the model. If you are creating a model this is the language you are using, not JSON .

Upvotes: -2

Jeremias Moraes
Jeremias Moraes

Reputation: 522

It probably should follow Open API json format, like Api Gateway "Error" model.

Error model

{
   "$schema":"http://json-schema.org/draft-04/schema#",
   "title":"Error Schema",
   "type":"object",
   "properties":{
      "message":{
         "type":"string"
      }
   }
}

Find out more at: Swagger Docs

Upvotes: 4

Bob Kinney
Bob Kinney

Reputation: 9020

You don't seem to be actually defining a schema for your data. Please refer to the API gateway documentation for some examples of defining a model with JSON schema.

Upvotes: 4

Related Questions