Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enumerate appropriate values? Validation rules? #1

Open
clintandrewhall opened this issue Nov 28, 2011 · 0 comments
Open

Enumerate appropriate values? Validation rules? #1

clintandrewhall opened this issue Nov 28, 2011 · 0 comments

Comments

@clintandrewhall
Copy link

I'm assuming the "1" values in the JSON file are just "truthy" values for now. What would you think of enumerating possible values? Perhaps even validation rules, (though that may be pushing it). For instance:

{
  'ENVIRONMENT' : {
    'values' : [ 'dev', 'prod', 'test' ]
  },
  'PORT' : {
    'validate' : function(value) {
      return value < 9999 && val > 1000;
    }
}

I don't think this validating impl "feels" right; it probably belongs in the biz logic, but there's something to be said for having it in the env spec for clarity. You get the idea. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant