There is no “error” if you use more than one key with the same name, but in JSON, the last key with the same name is the one that is going to be used.
In your case, the key “name” would be better to contain an array as it’s value, instead of having a number of keys “name”. It doesn’t make much sense the same object or “thing” to have two names, or two of the same properties that are in conflict.
E.g.:
{
"name" : [ "JOHN", "JACK", "...", ... ]
}
Related Contents:
- How to parse JSON in Java
- How to convert jsonString to JSONObject in Java
- How to parse a JSON string into JsonNode in Jackson?
- Convert JSON to Map
- “Expected BEGIN_OBJECT but was STRING at line 1 column 1”
- Parsing JSON array into java.util.List with Gson
- How to read json file into java with simple JSON library
- Parsing JSON string in Java
- GSON – Get JSON value from String
- Parse JSON from HttpURLConnection object
- Parsing JSON in Java without knowing JSON format
- Parsing JSON Array within JSON Object
- How to iterate over a JSONObject?
- How to convert hashmap to JSON object in Java
- java.net.SocketException: socket failed: EPERM (Operation not permitted)
- How to check whether a given string is valid JSON in Java
- “Content is not allowed in prolog” when parsing perfectly valid XML on GAE
- Issue with parsing the content from JSON file with Jackson & message- JsonMappingException -Cannot deserialize as out of START_ARRAY token
- Can you avoid Gson converting “” into unicode escape sequences?
- How can I tell jackson to ignore a property for which I don’t have control over the source code?
- Using Enums while parsing JSON with GSON
- JSON Java 8 LocalDateTime format in Spring Boot
- Convert Json Array to normal Java list
- what’s the correct way to send a file from REST web service to client?
- Deserialize JSON with Jackson into Polymorphic Types – A Complete Example is giving me a compile error
- Get a JSON object from a HTTP response
- Read response body in JAX-RS client from a post request
- JSONObject – How to get a value?
- Update elements in a JSONObject
- How can I Insert JSON object into Postgres using Java preparedStatement?
- how to parse JSON file with GSON
- Why does Jackson 2 not recognize the first capital letter if the leading camel case word is only a single letter long?
- Jackson JSON field mapping capitalization?
- Difference between @JsonIgnore and @JsonBackReference, @JsonManagedReference
- How to prevent null values inside a Map and null fields inside a bean from getting serialized through Jackson
- What’s the Jackson deserialization equivalent of @JsonUnwrapped?
- Converting from JSONArray to String then back again
- JSON Post request for boolean field sends false by default
- Why I’m not able to unwrap and serialize a Java map using the Jackson Java library?
- How to convert a hexadecimal string to long in java?
- Ignoring property when deserializing
- What are the different methods to parse strings in Java? [closed]
- Custom JSON Deserialization with Jackson
- JSONObject.toString: how NOT to escape slashes
- NoClassDefFoundError JsonAutoDetect while parsing JSON object
- How to Validate JSON with Jackson JSON
- Gson serialize null for specific class or field
- Which one is lighter, JSON or BSON?
- Jersey Exception : SEVERE: A message body reader for Java class
- Is it ok to save a JSON array in SharedPreferences?