dependabot[bot] on npm_and_yarn
Bump elliptic from 6.5.3 to 6.5… (compare)
System.Convert.ToString(value, cultureInfo);
This returns null if value is null
return "";
instead of null if the parameter is null
""
instead
app.UseSwaggerUi3(p => p.Path = "/")
@RicoSuter - I'm reading the OpenAPI 3 spec, and -- If I'm understanding it correctly -- it does seem to support "objects" as query parameters https://swagger.io/docs/specification/describing-parameters/#query-parameters:
"Query parameters can be primitive values, arrays and objects"
Related to that is how query parameters can be serialized: https://swagger.io/docs/specification/serialization/
PrepareRequest
methods to add the bearer token? and on the ProduceResponse
for the login method to get and store the token?
@RicoSuter - I am able to reproduce my "home route" problem starting from the sample "SampleOwinWebApiWithSwaggerUi" found here: https://github.com/NSwag/Samples/tree/master/src . Steps: 1) Run the sample and confirm that the home page shows up. 2) Upgrade all NSwag NuGet packages to 13.9.4. 3) In Startup.cs, change the call "UseSwaggerUi" to
UseSwaggerUi3(typeof(Startup).Assembly, s =>
{
s.Path = "/foo";
s.SwaggerRoutes.Add(new SwaggerUi3Route("My Fancy API v1", "/qwerty/asdf.json"));
});
Now when you run the project, instead of the home page, you see that it has been "hijacked" by raw Swagger JSON.
I've being using the partial client to add my JWT bearer tokens, but for some reason they don't always get added. But I can't see why.
async partial void PrepareRequest(HttpClient client, HttpRequestMessage request, string url)
{
_logger.LogInformation($"Prepare Request: {request.RequestUri.AbsoluteUri}");
var user = await _storage.GetItem<LoginResult>("user");
if (user != null)
{
_logger.LogInformation($"Adding Auth Header: {user.UserName}, {user.JwtToken}");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", user.JwtToken);
}
}
I can see in the chrome log the 'Preparing Request' and 'Adding Auth Header' messages, but the request has none added...its like the client as fired off the request already?