Skip to content

Commit 63cf302

Browse files
committed
TEMP COMMIT - Removing EnableOpenAPI flags to find out why tests fail
1 parent 3c4d854 commit 63cf302

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

src/ProjectTemplates/Web.ProjectTemplates/content/WebApiAot-CSharp/Program.Main.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,15 @@ public static void Main(string[] args)
1414
options.SerializerOptions.TypeInfoResolverChain.Insert(0, AppJsonSerializerContext.Default);
1515
});
1616

17-
#if (EnableOpenAPI)
1817
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
1918
builder.Services.AddOpenApi();
20-
#endif
2119

2220
var app = builder.Build();
2321

24-
#if (EnableOpenAPI)
2522
if (app.Environment.IsDevelopment())
2623
{
2724
app.MapOpenApi();
2825
}
29-
#endif
3026

3127
var sampleTodos = new Todo[] {
3228
new(1, "Walk the dog"),
@@ -37,7 +33,7 @@ public static void Main(string[] args)
3733
};
3834

3935
var todosApi = app.MapGroup("/todos");
40-
#if (EnableOpenAPI)
36+
4137
todosApi.MapGet("/", () => sampleTodos)
4238
.WithName("GetTodos");
4339

@@ -46,14 +42,6 @@ public static void Main(string[] args)
4642
? TypedResults.Ok(todo)
4743
: TypedResults.NotFound())
4844
.WithName("GetTodoById");
49-
#else
50-
todosApi.MapGet("/", () => sampleTodos);
51-
52-
todosApi.MapGet("/{id}", Results<Ok<Todo>, NotFound> (int id) =>
53-
sampleTodos.FirstOrDefault(a => a.Id == id) is { } todo
54-
? TypedResults.Ok(todo)
55-
: TypedResults.NotFound());
56-
#endif
5745

5846
app.Run();
5947
}

src/ProjectTemplates/Web.ProjectTemplates/content/WebApiAot-CSharp/Program.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,15 @@
88
options.SerializerOptions.TypeInfoResolverChain.Insert(0, AppJsonSerializerContext.Default);
99
});
1010

11-
#if (EnableOpenAPI)
1211
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
1312
builder.Services.AddOpenApi();
14-
#endif
1513

1614
var app = builder.Build();
1715

18-
#if (EnableOpenAPI)
1916
if (app.Environment.IsDevelopment())
2017
{
2118
app.MapOpenApi();
2219
}
23-
#endif
2420

2521
var sampleTodos = new Todo[] {
2622
new(1, "Walk the dog"),
@@ -31,7 +27,6 @@
3127
};
3228

3329
var todosApi = app.MapGroup("/todos");
34-
#if (EnableOpenAPI)
3530
todosApi.MapGet("/", () => sampleTodos)
3631
.WithName("GetTodos");
3732

@@ -40,14 +35,6 @@
4035
? TypedResults.Ok(todo)
4136
: TypedResults.NotFound())
4237
.WithName("GetTodoById");
43-
#else
44-
todosApi.MapGet("/", () => sampleTodos);
45-
46-
todosApi.MapGet("/{id}", Results<Ok<Todo>, NotFound> (int id) =>
47-
sampleTodos.FirstOrDefault(a => a.Id == id) is { } todo
48-
? TypedResults.Ok(todo)
49-
: TypedResults.NotFound());
50-
#endif
5138

5239
app.Run();
5340

0 commit comments

Comments
 (0)