dotnet / dotnet/aspnetcore

.NET 8 dotnet-user-jwts does not support JSON files with comments in them

Open
#55,557 4 comments 0 reactions 0 assignees View on GitHub
area-commandlinetools feature-userjwts
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

# Backport Request
Per @martincostello this was fixed for .NET 9, but has not yet been backported to .NET 8.

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

The tool `dotnet-user-jwts` does not work if appsettings.Development.json has any comments "//" in it.
This is different from the behavior of ApplicationBuilder.

### Expected Behavior

`dotnet-user-jwts` can parse any file which is considered valid by `IconfigurationBuilder.AddJsonFile(...)`.

### Steps To Reproduce

Add a comment line "//" to appsettings.Development.json, then run `dotnet user-jwts create`

### Exceptions (if any)

'/' is invalid after a value. Expected either ',', '}', or ']'.

### .NET Version

8.0.204

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.