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

Remove dependency on IConfigurationRoot in external service URL resolution #34

Open
idg10 opened this issue Feb 14, 2020 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@idg10
Copy link
Contributor

idg10 commented Feb 14, 2020

If a service enables external URL resolution with a call such as this:

services.AddExternalServices(
    "ExternalServices",
    externalServices =>
        externalServices.AddExternalServiceWithEmbeddedDefinition<OperationsStatusOpenApiService>("OperationsStatus"));

this introduces a service dependency on IConfigurationRoot. The AddExternalServices method takes a configuration section name, and retrieves it directly from IConfigurationRoot. The OpenApiExternalServices class that it passes this to then goes on to read configuration values dynamically from the configuration section in question based on the argument to AddExternalServiceWithEmbeddedDefinition.

So with the example above, it will look for an ExternalServices section with an OperationsStatus value. So we'd need a setting of the form ExternalServices:OperationsStatus

We've been trying to remove direct dependencies on IConfiguration or IConfigurationRoot from Corvus and Menes, partly because it can make it hard to discover what the expected configuration entries are, and also because it introduces complications with tests by requiring test code to supply an IConfiguration instead of just passing in the values of interest. We should make it possible to use this without needing IConfiguration either.

@idg10 idg10 added the enhancement New feature or request label Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant