
From a partner company I got a openapi.yaml file to evaluate their api for our use cases. Mostly I...
From a partner company I got a openapi.yaml file to evaluate their api for our use cases. Mostly I know those files from working with ASP.NET Core Apis + Swagger UI, but this time it was just a standalone file.
I got the file and an api key for the sandbox.
The first thing I was trying was to use the already known swagger ui as it's the same format.
So:
Swashbuckle.AspNetCore nugetopenapi.yaml file in the wwwroot foldervar builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.UseHttpsRedirection();
// Allow to serve the unknown-by-default file type .yaml
var provider = new FileExtensionContentTypeProvider();
provider.Mappings[".yaml"] = "application/yaml";
app.UseStaticFiles(new StaticFileOptions
{
ContentTypeProvider = provider,
});
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/openapi.yaml", "Imported API");
c.RoutePrefix = "swagger";
});
app.Run();
This worked almost, but then CORS came around :-(
Access to fetch at 'https://sandbox.***.com/api/...' from origin 'https://localhost:7298' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
The problem seems to be the browser, so let's look for a non-browser-solution.
Then I noticed that Postman got the functionality to import openapi spec files:

From here it's possible to simulate the api requests just as good (or better?) as in swagger UI.
aiMost of us have seen a coding agent fail to complete a task we know it can do. We just don't...
googlecloudWhen building Generative AI applications, developers often encounter a massive bottleneck: sequential...
discussI’ve been thinking about sharing some electronic circuit posts on Dev.to — small circuits, DIY...
agentsWhat nobody tells you about exporting your multi-agent prototype to a local workspace. Every...
agenticarchitectAutonomous agents are genuinely good at answering messy business questions. Give one an LLM and a set...
aiPR volume went up, ticket quality didn't, and the gap got filled with LLMs on both sides of the review: bots reviewing, bots replying, bots occasionally arguing with bots about priorities that only existed in a teammate's head. Our CEO named the actual problem, and it's bigger than code review.
Workflows from the Neura Market marketplace related to this Stable Diffusion resource