-
Notifications
You must be signed in to change notification settings - Fork 280
CLI params should override dredd.yaml #455
Comments
I agree, also it should be done on a one by one basis, so that if you have a yaml but want to, say change the hooks file, you can pass --hookfiles to override that current setting quickly |
@andyantrim @tu1ly would you all be able to maybe provide a simply use case here? As in, what is the situation where you would want to override hook files? What are the benefits this functionality would give you? What other configurations have you wanted to override? Thanks a lot! |
@tu1ly thanks for the reply, one instance I've found is when I want to use hookfiles or not, so I have the dress.yml file and if I run dredd blueprint.MD --hookfiles=hooks.oh --language python it should take in the stuff from the yaml and also override any params I pass in. I'm currently running against a mock (built to perfectly mirror the docs) and our actual implementation of the API, to check they match so the API endpoint is different! I get that maybe this case is best to just not use the yaml (which is what I'm doing atm) and the mock takes no hooks, Thanks |
Very cool! So you're mainly changing the URL Dredd calls and the hookfiles? |
Yes I'm not sure about node, but if there could be an option to default the yaml values and then have any CLI params override that! But yes, this is my use case! Thanks guys! |
@andyantrim Thanks for fielding all my questions. This decision for a feature like this will be handled by @netmilk, but I'm curious if your use case would be helped by having multiple configuration files instead of overwriting values? |
Just to add my 5 cents, overriding config file values from CLI is a common and sensible thing. Look at git or gdb or just any more complex command, the usual behaviour is that config file is the default and it gets get overridden by CLI specified values. |
I remember @netmilk told me this should be current behavior already except for What you describe here is probably already implemented (except for those two). Of course, there might be a bug. Also, it's subject for discussion whether the two properties shouldn't be also allowed to override as when they're not it can be confusing. |
It would be nice to be able to override |
+1 |
What is actually the reason you usually need to override the API description and/or the server? Debugging? Trying whether a different server fits the same description? I'm trying to understand the common behavior properly. |
hello, everyone is there a way to skip the dredd.yml file or override its values? |
By the way, as an alternative I renamed dredd.yml to something else and now I call dredd in two different ways:
|
@victorsferreira All options except of the API description and the server URL should be possible to override. Overriding the two needs a larger changes, roughly outlined in #1101 As a workaround, you can have multiple |
current:
if dredd.yaml is present then CLI params are not taken into the consideration
expected:
CLI params should override dredd.yaml params
The text was updated successfully, but these errors were encountered: