backend init defaults and inputs #20480
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
backend.ValidateConfig
toPrepareConfig
This mirrors the change made for providers, so that default values can
be inserted into the config by the backend implementation.
PrepareConfig
looks up any defaults and insert them into the config value before
validating and returning the config.
Fixes #19249
Related to #19256, but does not create a new
config.Body
for decoding. Currently, thePrepareConfig
call (neeValidateConfig
) will fail its own validation at this point before we have the complete config to merge with the original body.Fixing how config bodies are merged and decoded could possibly deal with future backend implementations that don't fully validate, but for now we would only be gaining an extra diagnostic with the line number of the backend block with the missing attribute[s].