You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe the problem.
It's not uncommon that one wants to add comments to appsettings*.json. Even the official ASP.NET Core docs contain such examples (see here):
{
// This file is not imported as a snippet so can be changed for testing....left out for brevity
But since the official JSON standard does not allow to use comments, this leads to schema validation errors in IDEs like JetBrains Rider:
Describe the solution you'd like
JSON5 is a well-adopted standard that extends JSON with comments. In contrast to JSONC, there is a proper specification (see here). But when renaming appsettings.json to appsettings.json5, neither a .NET CLI nor ASP.NET Core app picks up this config file anymore.
Of course, one could manually add them via config.AddJsonFile("appsettings.json5"); - but then you also have to add config.AddJsonFile($"appsettings.{env.EnvironmentName}.json5") for the environment-specific stuff.
Since JSON5 seems like a mature standard to me, I suggest adding OOTB support for appsettings*.json5. So far, I found the following spots:
Either close this issue and open a new one there, or wait until a member of the ASP.NET Core team that has the appropriate permissions transfers this issue there.
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
It's not uncommon that one wants to add comments to
appsettings*.json
. Even the official ASP.NET Core docs contain such examples (see here):But since the official JSON standard does not allow to use comments, this leads to schema validation errors in IDEs like JetBrains Rider:
Describe the solution you'd like
JSON5 is a well-adopted standard that extends JSON with comments. In contrast to JSONC, there is a proper specification (see here). But when renaming
appsettings.json
toappsettings.json5
, neither a .NET CLI nor ASP.NET Core app picks up this config file anymore.Of course, one could manually add them via
config.AddJsonFile("appsettings.json5");
- but then you also have to addconfig.AddJsonFile($"appsettings.{env.EnvironmentName}.json5")
for the environment-specific stuff.Since JSON5 seems like a mature standard to me, I suggest adding OOTB support for
appsettings*.json5
. So far, I found the following spots:ASP.NET Core
Sources
Current
New
.NET runtime
Sources
Current
New
Additional context
No response
The text was updated successfully, but these errors were encountered: