Update Jackson to 2.18.4#8449
Open
piotrp wants to merge 3 commits into
Open
Conversation
lciolecki
reviewed
Aug 4, 2025
| // note: "" deserializes to com.fasterxml.jackson.databind.node.MissingNode, | ||
| // which causes NPE when using Jackson 2.18.3+, because from this version on it decodes to null | ||
| val schemaForPlain: OpenAPIJsonSchema = OpenAPIJsonSchema("") | ||
| val schemaForJson: OpenAPIJsonSchema = OpenAPIJsonSchema("{}") |
Contributor
There was a problem hiding this comment.
Hmm, do we even need these two schemas?
Member
Author
There was a problem hiding this comment.
Unfortunately, yes:
class UniversalSchemaSupportDispatcher private (kafkaConfig: KafkaConfig) {
...
def forParsedSchema(parsedSchema: ParsedSchema): UniversalSchemaSupport = parsedSchema match {
// For ad hoc tests we want to present the user with json editor when topic has no schema and content type Json was selected
case ContentTypesSchemas.schemaForJson => NoSchemaJsonSupport
case _ => forSchemaType(parsedSchema.schemaType())
}
lciolecki
reviewed
Aug 4, 2025
lciolecki
reviewed
Aug 5, 2025
| // which causes NPE when using Jackson 2.18.3+, because from this version on it decodes to null | ||
| val schemaForPlain: OpenAPIJsonSchema = OpenAPIJsonSchema("") | ||
| val schemaForJson: OpenAPIJsonSchema = OpenAPIJsonSchema("{}") | ||
| val schemaForPlain: OpenAPIJsonSchema = OpenAPIJsonSchema("true") |
Contributor
There was a problem hiding this comment.
Are you sure about this? :)
Member
Author
There was a problem hiding this comment.
Yes, it's that or some heavier refactoring. true after parsing results in the same schema: {}. An alternative would be to use {} ({} with some whitespace around) with custom equals method for OpenAPIJsonSchema.
I mention custom equals because OpenAPIJsonSchema is a fake case class - default Scala's equals for case classes doesn't work there, it's implemented like this:
test("boxes are equal") {
class BoxParent {
override def equals(obj: Any): Boolean = true
override def hashCode(): Int = 0
}
case class Box(v: String) extends BoxParent
// this equality is true in Scala, but not in real world
Box("socks") shouldBe Box("gold")
}
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
TODO: solve Jackson incompatibility by removing changes from #7066. To sum up Slack discussion:
Checklist before merge