[fixed]Issue with post calls creating null records

I have set up an aws lambda api and tried making calls to it via postman. I can create successfull mongodb records that way. However when i send the request from custom gpt, it creates the record but the record values are all null.

No errors or issues seen anywhere, and when the ai asks for permisson before sending the request, it show me this body:

{
“amount”: 5,
“category”: “Food & Drinks”,
“description”: “Coffee”,
“date”: “2023-11-11:00:12:21-”
}

when i use the same body with postman, the aws api creates this record with no issues.

This is the latest schema structre:

{
“openapi”: “3.1.0”,
“info”: {
“title”: “API”,
“description”: “Your API specification”,
“version”: “v1.0.0”
},
“servers”: [
{
“url”: “myserverurl”
}
],
“paths”: {
“/myTestFunction”: {
“post”: {
“description”: “records spendings”,
“operationId”: “InsertSpendingRecord”,
“requestBody”: {
“content”: {
“application/json”: {
“schema”: {
“type”: “object”,
“properties”: {
“amount”: {
“type”: “number”
},
“category”: {
“type”: “string”
},
“description”: {
“type”: “string”
},
“date”: {
“type”: “string”
}
},
“required”: [“amount”, “category”, “description”, “date”]
}
}
},
“required”: true
},
“responses”: {
“200”: {
“description”: “Success”
}
}
}
}
},
“components”: {
“schemas”: {}
}
}

any ideas?

edit: adding “body”:{} to it fixed the issue. It was simple -.-

1 Like

Could you explain the fix? Where did you add "body": {}?

1 Like