-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d67384f
commit 91943c3
Showing
4 changed files
with
122 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...trar-core/src/main/patches/uniregistrar/openapi/model/SecretVerificationMethodInner.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- src/main/java/uniregistrar/openapi/model/SecretVerificationMethodInner.java 2023-11-05 20:15:11.061198670 +0100 | ||
+++ src/main/java/uniregistrar/openapi/model/SecretVerificationMethodInner.java.patched 2023-11-05 20:15:04.869182118 +0100 | ||
@@ -17,6 +17,7 @@ | ||
import java.nio.charset.StandardCharsets; | ||
import java.util.StringJoiner; | ||
import java.util.Objects; | ||
+import java.util.List; | ||
import java.util.Map; | ||
import java.util.HashMap; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
@@ -99,17 +100,17 @@ | ||
try { | ||
boolean attemptParsing = true; | ||
// ensure that we respect type coercion as set on the client ObjectMapper | ||
- if (List<@Valid VerificationMethodTemplate>.class.equals(Integer.class) || List<@Valid VerificationMethodTemplate>.class.equals(Long.class) || List<@Valid VerificationMethodTemplate>.class.equals(Float.class) || List<@Valid VerificationMethodTemplate>.class.equals(Double.class) || List<@Valid VerificationMethodTemplate>.class.equals(Boolean.class) || List<@Valid VerificationMethodTemplate>.class.equals(String.class)) { | ||
+ if (List.class.equals(Integer.class) || List.class.equals(Long.class) || List.class.equals(Float.class) || List.class.equals(Double.class) || List.class.equals(Boolean.class) || List.class.equals(String.class)) { | ||
attemptParsing = typeCoercion; | ||
if (!attemptParsing) { | ||
- attemptParsing |= ((List<@Valid VerificationMethodTemplate>.class.equals(Integer.class) || List<@Valid VerificationMethodTemplate>.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); | ||
- attemptParsing |= ((List<@Valid VerificationMethodTemplate>.class.equals(Float.class) || List<@Valid VerificationMethodTemplate>.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); | ||
- attemptParsing |= (List<@Valid VerificationMethodTemplate>.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); | ||
- attemptParsing |= (List<@Valid VerificationMethodTemplate>.class.equals(String.class) && token == JsonToken.VALUE_STRING); | ||
+ attemptParsing |= ((List.class.equals(Integer.class) || List.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); | ||
+ attemptParsing |= ((List.class.equals(Float.class) || List.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); | ||
+ attemptParsing |= (List.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); | ||
+ attemptParsing |= (List.class.equals(String.class) && token == JsonToken.VALUE_STRING); | ||
} | ||
} | ||
if (attemptParsing) { | ||
- deserialized = tree.traverse(jp.getCodec()).readValueAs(List<@Valid VerificationMethodTemplate>.class); | ||
+ deserialized = tree.traverse(jp.getCodec()).readValueAs(List.class); | ||
// TODO: there is no validation against JSON schema constraints | ||
// (min, max, enum, pattern...), this does not perform a strict JSON | ||
// validation, which means the 'match' count may be higher than it should be. | ||
@@ -213,7 +214,7 @@ | ||
} | ||
|
||
static { | ||
- schemas.put("List<@Valid VerificationMethodTemplate>", List<@Valid VerificationMethodTemplate>.class); | ||
+ schemas.put("List<@Valid VerificationMethodTemplate>", List.class); | ||
schemas.put("VerificationMethodPrivateData", VerificationMethodPrivateData.class); | ||
schemas.put("VerificationMethodPublicData", VerificationMethodPublicData.class); | ||
JSON.registerDescendants(SecretVerificationMethodInner.class, Collections.unmodifiableMap(schemas)); | ||
@@ -234,7 +235,7 @@ | ||
*/ | ||
@Override | ||
public void setActualInstance(Object instance) { | ||
- if (JSON.isInstanceOf(List<@Valid VerificationMethodTemplate>.class, instance, new HashSet<Class<?>>())) { | ||
+ if (JSON.isInstanceOf(List.class, instance, new HashSet<Class<?>>())) { | ||
super.setActualInstance(instance); | ||
return; | ||
} | ||
@@ -270,7 +271,7 @@ | ||
* @return The actual instance of `List<@Valid VerificationMethodTemplate>` | ||
* @throws ClassCastException if the instance is not `List<@Valid VerificationMethodTemplate>` | ||
*/ | ||
- public List<@Valid VerificationMethodTemplate> getList<@Valid VerificationMethodTemplate>() throws ClassCastException { | ||
+ public List<@Valid VerificationMethodTemplate> getListVerificationMethodTemplate() throws ClassCastException { | ||
return (List<@Valid VerificationMethodTemplate>)super.getActualInstance(); | ||
} | ||
|
||
@@ -342,11 +343,11 @@ | ||
} | ||
return joiner.toString(); | ||
} | ||
- if (getActualInstance() instanceof List<@Valid VerificationMethodTemplate>) { | ||
+ if (getActualInstance() instanceof List<?>) { | ||
if (getActualInstance() != null) { | ||
for (int i = 0; i < ((List<@Valid VerificationMethodTemplate>)getActualInstance()).size(); i++) { | ||
if (((List<@Valid VerificationMethodTemplate>)getActualInstance()).get(i) != null) { | ||
- joiner.add(((VerificationMethodTemplate)getActualInstance()).get(i).toUrlQueryString(String.format("%sone_of_2%s%s", prefix, suffix, | ||
+ joiner.add(((List<@Valid VerificationMethodTemplate>)getActualInstance()).get(i).toUrlQueryString(String.format("%sone_of_2%s%s", prefix, suffix, | ||
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); | ||
} | ||
} |