Kyle Montealto
Kyle Montealto

Reputation: 1

I can't generate body mapping template from model

I am trying to generate a body mapping template with this Youtube tutorial. All is well until the generating body template part. It doesn't seem to generate as expected. Is there a new step for the current version of API gateway?

I used this as my model schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "User",
    "type": "object",
    "properties": {
        "UserID": {
            "type": "string"
        },
        "Name": {
            "type": "string"
        },
        "Age": {
            "description": "Age in years",
            "type": "integer",
            "minimum": 18
        }
    },
    "required": ["UserID", "Name"]
}

This is what I was expecting to generate in the Integration request

#set($inputRoot = $input.path('$'))
{
    "UserID": "foo",
    "Name": "foo",
    "Age": 42
}

This is the actual output when trying to generate

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "User",
    "type": "object",
    "properties": {
        "UserID": {
            "type": "string"
        },
        "Name": {
            "type": "string"
        },
        "Age": {
            "description": "Age in years",
            "type": "integer",
            "minimum": 18
        }
    },
    "required": ["UserID", "Name"]
}

Upvotes: 0

Views: 20

Answers (0)

Related Questions