mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-08 11:26:08 +00:00
fix outdated link, improve docstring (#10870)
This commit is contained in:
@@ -151,6 +151,13 @@ public class JSON {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the parser to be liberal in what it accepts.
|
||||
*
|
||||
* @param lenientOnJson Set it to true to ignore some syntax errors
|
||||
* @return JSON
|
||||
* @see <a href="https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html">https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html</a>
|
||||
*/
|
||||
public JSON setLenientOnJson(boolean lenientOnJson) {
|
||||
isLenientOnJson = lenientOnJson;
|
||||
return this;
|
||||
@@ -179,7 +186,7 @@ public class JSON {
|
||||
try {
|
||||
if (isLenientOnJson) {
|
||||
JsonReader jsonReader = new JsonReader(new StringReader(body));
|
||||
// see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
|
||||
// see https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.5/com/google/gson/stream/JsonReader.html
|
||||
jsonReader.setLenient(true);
|
||||
return gson.fromJson(jsonReader, returnType);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user