I have a Spring `@ConfigurationProperties(prefix ...
# spring
e
I have a Spring
@ConfigurationProperties(prefix = "foo") data class Foo(val bar: Int?)
, when I write
foo.bar: "baz"
in my application.yaml, it still launches the application anyway and foo ends up being null. I want it to crash instead. Does anyone know if there's an easy way to achieve this?
I must've oversimplified something. A friend confirmed that this crashes as expected for him, so digging into what's different 🙂
e
Hi, so you both have different outcomes given the same setup?
I was debugging a similar thing and understood that Spring can silently pass null. I think you will get the expected errors if you have some: foo: bar: "baz" instead
e
We ended up testing with the wrong version of our code.. so the string was actually just never used.. 🤦‍♂️ homer disappear
👍 1
It errored as expected in all scenarios I could come up with when trying to come up with a minimal reproducer..
👍 2
I hope you figure out what scenario ended up with a silent null on your end though