-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
More powerful API Configuration #1888
Conversation
This looks solid. Haven't done a thorough CR yet, but wanted to discuss naming, first. If I am not mistaken we liberally confuse "api" and "endpoint", that is we mount endpoints but they are derived from I think Is there scope to I think we could simplify |
HI @dblock , updated with the new names. I agree mostly. |
I'm merging this. 👏 |
Addresses the feature request: #1883
Notes, because I did not want to introduce a name conflict in the user scope (i.e. someone else is very likely using the name
configuration
as a helper), I renamed the param toapi_configuration
, I'm open to a better naming if possible.To read the PR and understand the changes: There's a certain complexity on distinguishing between the command running at pre-setup time (i.e when it's being parsed and stored on the main API for re-playing on mount time) and mount time. As such, I've introduced the LazyValue objects which remember how they were accessed, and know that they are lazy, therefore I can distinguish evaluated params from params that should only be evaluated at Mount-Time.
Because I was adding features to the configuration, I've decided to add 2 additional ones that seemed used, conditionally executing code based on a configuration (unfortunately a simple
if
block won't do on the main namespace as I cannot record the unevaluated value. i.e. I only know the response of theif
statement, but I can never see that there was an if statement )And arbitrary code on mount (that admitdly would take care of the conditional issue assuming you were happy to moving the code to that block).
Each part of this PR is open for discussion