Comments (5)
There is no requirement to escape /, but it may be escaped. This is useful when embedding JSON in HTML.
from json-java.
I thought the grammar: http://json.org/ required it to be escaped. It's in the same list and no different from \b, \t, , etc. I'm worried about parser interoperability between different platforms like Java generated JSON on C++...
from json-java.
You are mistaken.
from json-java.
No he is right. JsonObject DOES quote forward slashes in JsonStringer.string(String value)
method.
from json-java.
@Doogiemuc the forward slash escape is technically optional in the JSON spec, which is what Douglas was talking about. The reason that this library escapes them is because embedding JSON directly into HTML can cause "remote code execution" issues when you don't escape them. We escape them by default for safety, not because it's required by the spec.
For more information see: https://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped#1580682
from json-java.
Related Issues (20)
- Minor: "latest release" points not to the newest release HOT 2
- Problem with optLong, getLong when parsing JSONObject and XML HOT 3
- JSONArray converting incorrect input string to array HOT 7
- Automatically update Javadoc with GitHub Actions HOT 1
- Update Wiki: Where are the unit tests HOT 1
- Download link is wrong HOT 1
- Implement strict mode for JSONObject HOT 3
- There is a Javadoc warning HOT 2
- Complete strictMode for JSONArray HOT 4
- Gentoo gets the "The system is out of resources." error on x86 in test phase. HOT 4
- All unit tests must pass in strict mode HOT 4
- JDK8 Compatibility Broken HOT 4
- Update JsonPath version HOT 1
- Info required for compatible version with openjdk21 HOT 2
- Converting a xml to json containing string converts the value to exponential format HOT 2
- Needs repairs and no ot sure how this country works HOT 3
- Johnson-java HOT 1
- Enhancement: Improve performance when parsing from String HOT 3
- JSONArray has a bug when calling addAll with a collection (infinite recursion) HOT 1
- Inquiry about License Changes for the JSON Library
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-java.