Questions tagged [minimal-apis]

Minimal APIs were introduced in ASP.NET Core 6 and are architected to create HTTP APIs with minimal dependencies. They are ideal for microservices and apps that want to include only the minimum files, features, and dependencies in ASP.NET Core.

Minimal APIs were introduced in ASP.NET Core 6 and are architected to create HTTP APIs with minimal dependencies. They are ideal for microservices and apps that want to include only the minimum files, features, and dependencies in ASP.NET Core.

Answers for many question can be found in the documentation.

236 questions
0
votes
0 answers

Putting web.config in angular application hosted directory stop working .NET 7 minimal API , throw error 405

I have a .NET 7 minimal API app and its hosted in IIS and same API is called in the another angular app which is hosted in same IIS. For example https://example.com is angular app URL where https://example.com/API is the API URL . Angular apps works…
rahularyansharma
  • 11,156
  • 18
  • 79
  • 135
0
votes
2 answers

How can i get base url of a c# minimal api application?

i have a minimal api application and i would like to return a path to file, most of the answers i found are for controller based APIs that use the Request to get the url from.
cabiste
  • 97
  • 1
  • 8
0
votes
1 answer

Why is my image not showing up in a minimal API image uploader?

I am making a very simple minimal api image uploader, and i cannot for the life of me figure out why the image will not show post upload. It launches properly, allows me to upload the image, saves the image in the correct directory, but will not…
0
votes
2 answers

Swagger for Minimal API

I'm trying to use minimal API in my project. the problem I'm facing is that the traditional Controllers are in a way that swagger generates a seperate section for each and every Controller. but I can't see an option to add this kind of seperation in…
SinaMN75
  • 6,742
  • 5
  • 28
  • 56
0
votes
0 answers

HTTP error with swagger ui with minimal API image uploader

I am attempting to use minimal api to develop an image uploader. I have the program.cs file code debugged and it launches to a webpage with an http 404 error. This is the entirety of the code. using System.Text.Json; using…
0
votes
1 answer

Trouble upgrading IEndpointRouteBuilder method from .Net6 to .Net8

The following method defines my endpoints and worked fine in .Net 6. I am upgrading this app now to .Net 8 before I get to far along since that will be standard in a few months. public static void DefineEndpoints(IEndpointRouteBuilder app) { …
dinotom
  • 4,990
  • 16
  • 71
  • 139
0
votes
0 answers

can Minimal API handle big request?

I want integrate Flutter with an ASP.NET API. the problem is when I create minimal API, the JSON I retrieved from MapGet taken too long to load, is the limit for how big can minimal api load? this is my scheme [ { "id":…
user21497668
0
votes
0 answers

Storing Firebase's users in SQL database using Firebase Auth, React Native, .NET Minimal API - Best Practice

I came here to ask you for suggestions about best practices for storing Firebase's user data in own SQL database. I have made .NET Minimal API project for back-end, React Native for front-end and I am using Firebase Auth for authenticate users…
0
votes
1 answer

.NET 7 minimal API request timeout

I found this in .NET 8 (prerelease) but I can't use it due to company policy. https://learn.microsoft.com/en-us/aspnet/core/performance/timeouts?view=aspnetcore-8.0&viewFallbackFrom=aspnetcore-7.0 May I know how can I do the same in .NET core 7?
s k
  • 4,342
  • 3
  • 42
  • 61
0
votes
1 answer

ArgumentException Object serialized to String. JObject instance expected

How do I modify my exception middleware to still continue execution of this code below: public async Task TransferSecondModelData() { //get the untransferred records and prep for transfer List records =…
Prosy Arceno
  • 2,616
  • 1
  • 8
  • 32
0
votes
0 answers

Policy in Minimal API - OR condition

I have a very simple minimal API (.NET 6 with JWT Authentication Scheme) with 5 endpoints which: 2 are read, protected by a "ReadScope" 3 are write, protected by a "WriteScope" app.MapGet("v1/getpet", GetPet) …
Steven
  • 23
  • 7
0
votes
0 answers

${aspnet-request-posted-body} with appsetings based configuration

I was reading whole topics on StackOverflow and NLog's wiki but nothing works for me.. Maybe I am unable to see something and someone could see it. I have a minimal API and I would like to log my request from a certain logger. I found that from…
frozzen10
  • 101
  • 4
0
votes
1 answer

Bearer error="invalid_token", error_description="The signature key was not found" using auth0

I am having an issue with authenticating my webapi(.net core 7 minimal api) requests:I can successfully generate a token but when I pass it over to another endpoint that requires authentication I get the error: Bearer error="invalid_token",…
Jack M
  • 2,564
  • 4
  • 28
  • 49
0
votes
0 answers

API url conflict when using localization

I have an ASPNET Razor pages app where i use localization; i would also need to use the same application to expose some API endpoints using minimal APIs. With this class: public class CultureTemplatePageRouteModelConvention :…
Cris
  • 12,124
  • 27
  • 92
  • 159
0
votes
1 answer

Multidimensional array parameter binding with ASP.NET Minimal API

I have quite a few places where multidimensional arrays of varying lengths are used as query parameters. With controllers a request with to /multi?vals[0][0]=5&vals[0][1]=6&vals[1][0]=6&vals[1][1]=7 binds without issues. [Route("/multi")] …
bep
  • 952
  • 2
  • 12
  • 21