From 39caded68b81f512a942203641ed92e8ed817f54 Mon Sep 17 00:00:00 2001 From: Samuel Denis-D'Ortun Date: Sun, 1 Aug 2021 15:56:58 -0400 Subject: [PATCH 1/2] Change Markdown comment type from JSON to JSON5 to allow comments --- _includes/cloudcode/cloud-code-advanced.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/_includes/cloudcode/cloud-code-advanced.md b/_includes/cloudcode/cloud-code-advanced.md index 7a9f0bebb..639b5fb8e 100644 --- a/_includes/cloudcode/cloud-code-advanced.md +++ b/_includes/cloudcode/cloud-code-advanced.md @@ -206,7 +206,7 @@ end Here's an example of the JSON data that would be sent in the request to this webhook: -```json +```json5 // Sent to webhook { "master": false, @@ -225,14 +225,14 @@ Here's an example of the JSON data that would be sent in the request to this web This response would indicate a success in the webhook: -```json +```json5 // Returned from the webhook on success { "success": "Hello World!" } ``` This response would indicate an error in the webhook: -```json +```json5 // Returned from the webhook on error { "error": "Error message >:(" } ``` @@ -275,7 +275,7 @@ end Here's an example of the JSON data that would be sent in the request to this webhook: -```json +```json5 // Sent to webhook { "master": true, @@ -287,7 +287,7 @@ Here's an example of the JSON data that would be sent in the request to this web This response would indicate a success in the webhook: -```json +```json5 // Returned from the webhook on success { "success": "User billed!" } ``` @@ -310,7 +310,7 @@ For triggers, the following parameters are sent to your webhook. To respond to a `beforeSave` request, send a JSON object with the key `error` or `success` set. This is the same as for Cloud functions, but there's an extra capability with `beforeSave` triggers. By returning an error, you will cancel the save request and the object will not be stored on Parse. You can also return a JSON object in this following format to override the values that will be saved for the object: -```json +```json5 { "className": "AwesomeClass", "existingColumn": "sneakyChange", @@ -348,7 +348,7 @@ end Here's an example of the JSON data that would be sent in the request to this webhook: -```json +```json5 // Sent to webhook { "master": false, @@ -419,7 +419,7 @@ end Here's an example of the JSON data that would be sent in the request to this webhook: -```json +```json5 // Sent to webhook { "master": false, @@ -485,7 +485,7 @@ end Here's an example of the JSON data that would be sent in the request to this webhook: -```json +```json5 // Sent to webhook { "master": false, @@ -509,7 +509,7 @@ Here's an example of the JSON data that would be sent in the request to this web This response would indicate a success in the webhook: -```json +```json5 // Returned from the webhook on success { "success": true } ``` @@ -554,7 +554,7 @@ end Here's an example of the JSON data that would be sent in the request to this webhook: -```json +```json5 // Sent to webhook { "master": false, From 0f3f39a00a338f811a5b73f8125ac00bc429a94c Mon Sep 17 00:00:00 2001 From: Samuel Denis-D'Ortun Date: Sun, 1 Aug 2021 16:01:42 -0400 Subject: [PATCH 2/2] Fix JSON comments --- _includes/js/objects.md | 12 +++++++++--- _includes/php/objects.md | 12 +++++++++--- _includes/php/setup.md | 4 +++- _includes/rest/hooks.md | 2 +- _includes/rest/users.md | 1 + _includes/unity/objects.md | 4 ++-- 6 files changed, 25 insertions(+), 10 deletions(-) diff --git a/_includes/js/objects.md b/_includes/js/objects.md index c3fce7580..6d9ce8873 100644 --- a/_includes/js/objects.md +++ b/_includes/js/objects.md @@ -144,9 +144,15 @@ gameScore.save() After this code runs, you will probably be wondering if anything really happened. To make sure the data was saved, you can look at the Data Browser in your app on Parse. You should see something like this: -```json -objectId: "xWMyZ4YEGZ", score: 1337, playerName: "Sean Plott", cheatMode: false, -createdAt:"2011-06-10T18:33:42Z", updatedAt:"2011-06-10T18:33:42Z" +```json5 +{ + objectId: "xWMyZ4YEGZ", + score: 1337, + playerName: "Sean Plott", + cheatMode: false, + createdAt: "2011-06-10T18:33:42Z", + updatedAt: "2011-06-10T18:33:42Z" +} ``` There are two things to note here. You didn't have to configure or set up a new Class called `GameScore` before running this code. Your Parse app lazily creates this Class for you when it first encounters it. diff --git a/_includes/php/objects.md b/_includes/php/objects.md index c4abe9d5d..b5418bfc6 100644 --- a/_includes/php/objects.md +++ b/_includes/php/objects.md @@ -35,9 +35,15 @@ try { After this code runs, you will probably be wondering if anything really happened. To make sure the data was saved, you can look at the Data Browser in your app on Parse. You should see something like this: -```json -objectId: "xWMyZ4YEGZ", score: 1337, playerName: "Sean Plott", cheatMode: false, -createdAt:"2011-06-10T18:33:42Z", updatedAt:"2011-06-10T18:33:42Z" +```json5 +{ + objectId: "xWMyZ4YEGZ", + score: 1337, + playerName: "Sean Plott", + cheatMode: false, + createdAt: "2011-06-10T18:33:42Z", + updatedAt: "2011-06-10T18:33:42Z" +} ``` There are two things to note here. You didn't have to configure or set up a new Class called `GameScore` before running this code. Your Parse app lazily creates this Class for you when it first encounters it. diff --git a/_includes/php/setup.md b/_includes/php/setup.md index 4d7cbe667..3f0753e2f 100644 --- a/_includes/php/setup.md +++ b/_includes/php/setup.md @@ -62,13 +62,15 @@ Note that it is _not_ guaranteed that 'response' will be a parsable json array. A couple examples of bad health responses could include an incorrect mount path, port or domain. -```json +```json5 // ParseClient::setServerURL('http://localhost:1337', 'not-good'); { "status": 404, "response": "...Cannot GET \/not-good\/health..." } +``` +```json5 // ParseClient::setServerURL('http://__uh__oh__.com', 'parse'); { "status": 0, diff --git a/_includes/rest/hooks.md b/_includes/rest/hooks.md index 6fe19762a..c7a2159a1 100644 --- a/_includes/rest/hooks.md +++ b/_includes/rest/hooks.md @@ -220,7 +220,7 @@ and perform a `parse deploy` the usual way. To create a new function webhook post to /parse/hooks/functions with payload in the format ```json -{"functionName" : x, "url" : y} +{"functionName" : "baz", "url" : "https://api.example.com/baz"} ``` Post example: diff --git a/_includes/rest/users.md b/_includes/rest/users.md index 025cb6470..6b62ae36c 100644 --- a/_includes/rest/users.md +++ b/_includes/rest/users.md @@ -600,6 +600,7 @@ The ACL is formatted as a JSON object where the keys are either object ids or th For example, if you want the user with id `"3KmCvT7Zsb"` to have read and write access to an object, plus the object should be publicly readable, that corresponds to an ACL of: ```json +{ "ACL": { "3KmCvT7Zsb": { "read": true, diff --git a/_includes/unity/objects.md b/_includes/unity/objects.md index 48af37bf1..f75b170df 100644 --- a/_includes/unity/objects.md +++ b/_includes/unity/objects.md @@ -6,8 +6,8 @@ Storing data on Parse is built around the `ParseObject`. Each `ParseObject` cont For example, let's say you're tracking high scores for a game. A single `ParseObject` could contain: -```json -score: 1337, playerName: "Sean Plott", cheatMode: false +```json5 +{score: 1337, playerName: "Sean Plott", cheatMode: false } ``` Keys must start with a letter, and can contain alphanumeric characters and underscores. Values can be strings, numbers, booleans, or even arrays and dictionaries - anything that can be JSON-encoded.