🐛 Trying to fix JSON float
This commit is contained in:
		| @@ -12,6 +12,7 @@ using NodaTime; | |||||||
| using NodaTime.Serialization.SystemTextJson; | using NodaTime.Serialization.SystemTextJson; | ||||||
| using StackExchange.Redis; | using StackExchange.Redis; | ||||||
| using System.Text.Json; | using System.Text.Json; | ||||||
|  | using System.Text.Json.Serialization; | ||||||
| using System.Threading.RateLimiting; | using System.Threading.RateLimiting; | ||||||
| using DysonNetwork.Pass.Auth.OidcProvider.Options; | using DysonNetwork.Pass.Auth.OidcProvider.Options; | ||||||
| using DysonNetwork.Pass.Auth.OidcProvider.Services; | using DysonNetwork.Pass.Auth.OidcProvider.Services; | ||||||
| @@ -70,6 +71,7 @@ public static class ServiceCollectionExtensions | |||||||
|  |  | ||||||
|         services.AddControllers().AddJsonOptions(options => |         services.AddControllers().AddJsonOptions(options => | ||||||
|         { |         { | ||||||
|  |             options.JsonSerializerOptions.NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals; | ||||||
|             options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower; |             options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower; | ||||||
|             options.JsonSerializerOptions.DictionaryKeyPolicy = JsonNamingPolicy.SnakeCaseLower; |             options.JsonSerializerOptions.DictionaryKeyPolicy = JsonNamingPolicy.SnakeCaseLower; | ||||||
|  |  | ||||||
| @@ -132,7 +134,8 @@ public static class ServiceCollectionExtensions | |||||||
|             { |             { | ||||||
|                 Version = "v1", |                 Version = "v1", | ||||||
|                 Title = "Dyson Pass", |                 Title = "Dyson Pass", | ||||||
|                 Description = "The authentication service of the Dyson Network. Mainly handling authentication and authorization.", |                 Description = | ||||||
|  |                     "The authentication service of the Dyson Network. Mainly handling authentication and authorization.", | ||||||
|                 TermsOfService = new Uri("https://solsynth.dev/terms"), |                 TermsOfService = new Uri("https://solsynth.dev/terms"), | ||||||
|                 License = new OpenApiLicense |                 License = new OpenApiLicense | ||||||
|                 { |                 { | ||||||
|   | |||||||
| @@ -25,7 +25,7 @@ public class GeoIpService(IOptions<GeoIpOptions> options) | |||||||
|             using var reader = new DatabaseReader(_databasePath); |             using var reader = new DatabaseReader(_databasePath); | ||||||
|             var city = reader.City(ipAddress); |             var city = reader.City(ipAddress); | ||||||
|              |              | ||||||
|             if (city?.Location == null || !city.Location.HasCoordinates) |             if (city?.Location is not { HasCoordinates: true }) | ||||||
|                 return null; |                 return null; | ||||||
|  |  | ||||||
|             return _geometryFactory.CreatePoint(new Coordinate( |             return _geometryFactory.CreatePoint(new Coordinate( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user