Open
Description
Reproduction Steps
Step 1: Add .env
file
WRITABLE_PATH=/tmp/uploads
ROOT_URL=http://localhost:4000
PORT=4000
NODE_ENV=development
WITH_API=true
Step 2: Start Server From VS Code
Using the launch.json configuration Meteor: Node
Lines 4 to 20 in ad3306e
Step 3: Get an API Token
curl -X POST \
http://localhost:4000/users/login \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"username": "string", "password": "pa$$word"}'
Step 4: Send an add_comment
Request
curl -X POST \
'http://localhost:4000/api/boards/foo/cards/bar/comments' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ***************' \
-H 'Content-Type: application/json'
Actual Output
An HTTP 500 response:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>TypeError: Converting circular structure to JSON<br> --> starting at object with constructor 'SimpleSchemaValidationContext'<br> | property '_simpleSchema' -> object with constructor 'SimpleSchema'<br> | property '_validationContexts' -> object with constructor 'Object'<br> --- property 'default' closes the circle<br> at JSON.stringify (<anonymous>)<br> at writeJsonToBody (packages/simple_json-routes.js:157:20)<br> at Object.JsonRoutes.sendResult (packages/simple_json-routes.js:140:3)<br> at models/cardComments.js:342:20<br> at packages/simple_json-routes.js:100:9</pre>
</body>
</html>
Expected Output
An HTTP 400 response due to missing parameters
Server Log
TypeError: Converting circular structure to JSON
--> starting at object with constructor 'SimpleSchemaValidationContext'
| property '_simpleSchema' -> object with constructor 'SimpleSchema'
| property '_validationContexts' -> object with constructor 'Object'
--- property 'default' closes the circle
at JSON.stringify (<anonymous>)
at writeJsonToBody (packages/simple_json-routes.js:157:20)
at Object.JsonRoutes.sendResult (packages/simple_json-routes.js:140:3)
at models/cardComments.js:342:20
at packages/simple_json-routes.js:100:9