Ask Your Question
2

What is the process for representing a JSON object that contains slashes in its field name?

asked 2022-05-06 11:00:00 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-08-01 13:00:00 +0000

djk gravatar image

When representing a JSON object that contains slashes in its field name, it is recommended to use backslashes to escape the forward slashes. For example, if a JSON object contains a field name "foo/bar" the representation would be:

{
  "foo\/bar": "value"
}

In this example, the forward slash is escaped with a backslash. When parsing the JSON object, the receiving application should automatically recognize the escaped forward slash and treat it as a part of the field name.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-05-06 11:00:00 +0000

Seen: 11 times

Last updated: Aug 01 '22