paulschwarz / spring-dotenv

Provides a Dotenv property source for Spring
MIT License
301 stars 23 forks source link

Check property name variations #27

Open natrem opened 9 months ago

natrem commented 9 months ago

Apply relaxed binding as spring boot implementations

As discussed in the issue, the implementation supports more than only the documented pattern:

  1. initial property name e.g. this.is-a_PROPERTY
  2. initial property name, replacing dots . by underscores _, e.g. this_is-a_PROPERTY
  3. initial property name, replacing hyphens - by underscores _, e.g. this.is_a_PROPERTY
  4. initial property name, replacing dots . and hyphens - by underscores _, e.g. this_is_a_PROPERTY
  5. uppercase property name, e.g. THIS.IS-A_PROPERTY
  6. uppercase property name, replacing dots . by underscores _, e.g. THIS_IS-A_PROPERTY
  7. uppercase property name, replacing hyphens - by underscores _, e.g. THIS.IS_A_PROPERTY
  8. uppercase property name, replacing dots . and hyphens - by underscores _, e.g. THIS_IS_A_PROPERTY

The tests focus on validating the documented pattern: if the code requires a property named this.is-a-property (or other combination of dots and hyphens), then providing THIS_IS_A_PROPERTY in dotenv file works.

close #16

natrem commented 8 months ago

@paulschwarz not to pressure you, but did/will you have some time to check this out?