You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we load and validate config outside of nestjs and just provide already parsed config to the module like this
ConfigModule.forRoot({isGlobal: true,ignoreEnvFile: true,ignoreEnvVars: true,expandVariables: false,// no validation needed, it is validated during loadvalidate: (config)=>config,load: [get],})
typings are correct, it recognises numbers, booleans, e.t.c, but returns raw string value from _cache causing broken types
Minimum reproduction code
aint nobody got time for that (sorry)
Steps to reproduce
No response
Expected behavior
validate logic should be called on objects loaded from custom loaders to have consistent logic and safe types
Package version
3.1.1
NestJS version
10.2.6
Node.js version
18.16.0
In which operating systems have you tested?
macOS
Windows
Linux
Other
Sorry that I did not provide reproduction code, but it is easy to track down without it. Either trust loaded config and add it to validated cache, or run validation logic to add it there
The text was updated successfully, but these errors were encountered:
I bumped into this as well and would benefit from the behaviour being changed :D
EDIT: As a workaround, I just manually validated each slice before returning it from registerAs and ended up not having it on the main configuration object.
Is there an existing issue for this?
Current behavior
we load and validate config outside of nestjs and just provide already parsed config to the module like this
when we try to use config service
typings are correct, it recognises numbers, booleans, e.t.c, but returns raw string value from _cache causing broken types
Minimum reproduction code
aint nobody got time for that (sorry)
Steps to reproduce
No response
Expected behavior
validate logic should be called on objects loaded from custom loaders to have consistent logic and safe types
Package version
3.1.1
NestJS version
10.2.6
Node.js version
18.16.0
In which operating systems have you tested?
Other
Sorry that I did not provide reproduction code, but it is easy to track down without it. Either trust loaded config and add it to validated cache, or run validation logic to add it there
The text was updated successfully, but these errors were encountered: