Is 3.2's new type safe config working for anyone e...
# ktor
a
Is 3.2's new type safe config working for anyone else? Always throws a MissingFieldException with 3.2.1, in this case with
Fields [apiKey, emails, templates] are required for type with serial name <config class>, but they were missing
The only thing that works is serializing primitive types.
Querying the properties directly (e.g.
sendgrid.apiKey
) works fine, but serialization claims they are missing
b
Maybe it's not hitting the right base property? You could try printing out
property("sendgrid").asMap()
to see what keys are actually found in the config
a
All the keys seem in order:
Copy code
{emails={system=system@local, info=info@local}, apiKey=none, templates={paymentConfirmed=payment_confirmed, passwordLink=password_link}}
b
hmm maybe it's an issue with the env variable references with no defaults... have you tried it with strings in place for those?
a
Yep, the test map above was generated with simple strings instead of env vars
Seems like it's an issue with hocon serialization, switching to a yaml file fixes the issue
b
looks like it has something to do with the default property
baseUrl
... if you remove the default it works properly
I'll log an issue to fix 🐛
❤️ 1
a
Thank you!