envparse icon indicating copy to clipboard operation
envparse copied to clipboard

Feature/schema-env-processors-fix

Open jdockerty opened this issue 4 years ago • 0 comments

This change enables a user to utilise a preprocessor or a postprocessor with the schema syntax. E.g.

test_env = Env(TEST=dict(cast=str, preprocessor=lambda v: v.upper()))

Prior to this, the pre/post processors would not fire, as they were not checked within the schema value. As such, the above code would show that the value of test_env('TEST') was hello, rather than HELLO if the processor had been applied. With this small addition, they now fire and work as I expected them too. I have added the accompanying tests too.

I hope this makes sense, feel free to make any alterations or comments as required.

jdockerty avatar Apr 27 '21 18:04 jdockerty