Comments (1)
Sachin, fork Ocelot repo first to look into the Ocelot code!
After forking Ocelot you will figure out that AddJsonFile
method is a part of JsonConfigurationExtensions
class from Microsoft.Extensions.Configuration
namespace!
If you press F12 key multiple times, you will get to this Microsoft ASP.NET implementation:
/// <summary>
/// Adds a JSON configuration source to <paramref name="builder"/>.
/// </summary>
/// <param name="builder">The <see cref="IConfigurationBuilder"/> to add to.</param>
/// <param name="provider">The <see cref="IFileProvider"/> to use to access the file.</param>
/// <param name="path">Path relative to the base path stored in
/// <see cref="IConfigurationBuilder.Properties"/> of <paramref name="builder"/>.</param>
/// <param name="optional">Whether the file is optional.</param>
/// <param name="reloadOnChange">Whether the configuration should be reloaded if the file changes.</param>
/// <returns>The <see cref="IConfigurationBuilder"/>.</returns>
public static IConfigurationBuilder AddJsonFile(this IConfigurationBuilder builder, IFileProvider? provider, string path, bool optional, bool reloadOnChange)
{
ThrowHelper.ThrowIfNull(builder);
if (string.IsNullOrEmpty(path))
{
throw new ArgumentException(SR.Error_InvalidFilePath, nameof(path));
}
return builder.AddJsonFile(s =>
{
s.FileProvider = provider;
s.Path = path;
s.Optional = optional;
s.ReloadOnChange = reloadOnChange;
s.ResolveFileProvider();
});
}
I have no idea how inner MS implementation merges config JSON.
If you call
.AddJsonFile("student.ocelot.Development.json", false, true)
.AddJsonFile("teacher.ocelot.Development.json", false, true)
and they describe the same routes, seems the second file will overwrite the routes from the first one.
Microsoft classes don't merge!
from ocelot.
Related Issues (20)
- Operating memory research HOT 11
- More open customization of Polly use HOT 2
- sockect seems like not reuse on cenos or docker but reuse in window(iis) HOT 2
- Default timeout of HttpClient via route configuration HOT 14
- File-scoped namespace HOT 2
- Use Polly v8 syntax HOT 4
- Authentication docs could do with a note around .NET 8 changes HOT 1
- The Getting Started document could be updated for .NET 8 HOT 4
- Use Ocelot / Identity Server4 JwtBearerEvents.OnAuthenticationFailed addHeaders not work HOT 9
- Apply rate limiting globally HOT 5
- Download file API causes Gateway memory to rise by fileSize HOT 15
- UpstreamHost not working HOT 8
- Routes containing attribute "UpstreamHost " cannot be found HOT 1
- Issue with Aggregator in Ocelot: Requires At Least Two Routes to Execute HOT 11
- 在使用异步流返回时,并不是实时刷新逐条返回结果,而是一次返回结果 HOT 10
- How to Authorize with nested JWT claim generated from Keycloak
- Access to the path '/app/ocelot.json' is denied HOT 1
- Ocelot is missing NuGet package README file HOT 3
- Kubernetes provider should identify different ports HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ocelot.