Hello! I'm using Jackson to consume data returned by the AdoptOpenJDK API [0]. This JSON doesn't contain type annotations, but I do know all of the types ahead of time thanks to their publishing of a schema via Swagger.
I've defined the set of types published by the API: https://raw.githubusercontent.com/AdoptOpenJDK/openjdk-api-java-client/feature/v3/net.adoptopenjdk.v3.vanilla/src/main/java/net/adoptopenjdk/v3/vanilla/AOV3AST.java Deserializing values of these types works correctly when using an object mapper that uses nearly the default settings: https://raw.githubusercontent.com/AdoptOpenJDK/openjdk-api-java-client/feature/v3/net.adoptopenjdk.v3.vanilla/src/main/java/net/adoptopenjdk/v3/vanilla/AOV3ObjectMappers.java However, for reasons of paranoia, I'd now like to configure the object mapper such that the set of types it is allowed to deserialize is fixed. In other words: A deserialization whitelist. Specifically, the whitelist would look like this: net.adoptopenjdk.v3.vanilla.AOV3AST.AOV3ReleaseNamesJSON net.adoptopenjdk.v3.vanilla.AOV3AST.AOV3AvailableReleasesJSON net.adoptopenjdk.v3.vanilla.AOV3AST.AOV3ReleaseVersionJSON net.adoptopenjdk.v3.vanilla.AOV3AST.AOV3ReleaseVersionsJSON net.adoptopenjdk.v3.vanilla.AOV3AST.AOV3InstallerJSON net.adoptopenjdk.v3.vanilla.AOV3AST.AOV3PackageJSON net.adoptopenjdk.v3.vanilla.AOV3AST.AOV3BinaryJSON net.adoptopenjdk.v3.vanilla.AOV3AST.AOV3SourceJSON net.adoptopenjdk.v3.vanilla.AOV3AST.AOV3ReleaseJSON java.math.BigInteger java.net.URI java.util.List Additionally, I'd need one concrete List implementation, but I'm not sure which that would be. I'm happy to use whatever Jackson is choosing internally. What is the most efficient way to set up this whitelist? -- Mark Raynsford | http://www.io7m.com [0] https://api.adoptopenjdk.net/swagger-ui/#/ -- You received this message because you are subscribed to the Google Groups "jackson-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jackson-user/20200327202716.1191d38a%40sunflower.int.arc7.info.
pgpjelEZMqY4m.pgp
Description: OpenPGP digital signature
