1 type derived from Todo
Microsoft.AspNetCore.OpenApi.Tests (1)
Shared\SharedTypes.cs (1)
15
internal record TodoWithDueDate(int Id, string Title, bool Completed, DateTime CreatedAt, DateTime DueDate) :
Todo
(Id, Title, Completed, CreatedAt);
48 instantiations of Todo
Microsoft.AspNetCore.OpenApi.Tests (48)
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Responses.cs (1)
195
builder.MapGet("/api/todos", [Produces("application/json", "application/xml")] () => new
Todo
(1, "Test todo", false, DateTime.Now));
Services\OpenApiSchemaService\OpenApiSchemaService.ResponseSchemas.cs (9)
61
builder.MapGet("/api", () => new
Todo
(1, "Test Title", true, DateTime.Now));
152
static Todo? GetTodo() => Random.Shared.Next() < 0.5 ? new
Todo
(1, "Test Title", true, DateTime.Now) : null;
384
builder.MapGet("/api", () => TypedResults.Created("/test/1", new { Id = 1, Name = "Test", Todo = new
Todo
(1, "Test", true, DateTime.Now) }));
447
builder.MapGet("/", () => TypedResults.Ok<List<Todo>>([new
Todo
(1, "Test Title", true, DateTime.Now), new
Todo
(2, "Test Title 2", false, DateTime.Now)]));
494
builder.MapGet("/", () => TypedResults.Ok<PaginatedItems<Todo>>(new(0, 1, 5, 50, [new
Todo
(1, "Test Title", true, DateTime.Now), new
Todo
(2, "Test Title 2", false, DateTime.Now)])));
635
builder.MapGet("/", () => new ClassWithObjectProperty { Object = new
Todo
(1, "Test Title", true, DateTime.Now) });
707
internal Todo Get() =>
new
(1, "Write test", false, DateTime.Now);
Transformers\DocumentTransformerTests.cs (3)
169
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
197
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
224
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
Transformers\Implementations\OpenApiSchemaReferenceTransformerTests.cs (2)
274
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
459
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
Transformers\OperationTransformerTests.cs (4)
407
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
434
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
461
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
462
builder.MapGet("/todo-2", () => new
Todo
(1, "Item1", false, DateTime.Now));
Transformers\SchemaTransformerTests.cs (16)
74
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
111
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
129
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
179
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
209
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
239
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
262
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
286
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
324
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
361
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
387
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
515
builder.MapGet("/list-of-todo", () => new List<Todo> { new
Todo
(1, "Item1", false, DateTime.Now) });
708
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
764
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
791
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
818
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
Transformers\TypeBasedTransformerLifetimeTests.cs (13)
18
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
40
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
66
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
92
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
117
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
139
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
164
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
190
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
215
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
236
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
259
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
285
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
311
builder.MapGet("/todo", () => new
Todo
(1, "Item1", false, DateTime.Now));
67 references to Todo
Microsoft.AspNetCore.OpenApi.Tests (67)
Extensions\JsonTypeInfoExtensionsTests.cs (5)
52
[typeof(
Todo
), "Todo"],
53
[typeof(IEnumerable<
Todo
>), null],
54
[typeof(List<
Todo
>), null],
63
[typeof(Results<Ok<TodoWithDueDate>, Ok<
Todo
>>), "ResultsOfOkOfTodoWithDueDateAndOkOfTodo"],
64
[typeof(Ok<
Todo
>), "OkOfTodo"],
Services\CreateSchemaReferenceIdTests.cs (4)
67
builder.MapPost("/", (
Todo
todo) => { });
116
builder.MapPost("/", (
Todo
todo) => { });
164
builder.MapPost("/", (
Todo
todo) => new TodoWithDueDate(todo.Id, todo.Title, todo.Completed, todo.CreatedAt, DateTime.UtcNow));
207
builder.MapPost("/", (
Todo
todo) => new TodoWithDueDate(todo.Id, todo.Title, todo.Completed, todo.CreatedAt, DateTime.UtcNow));
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Parameters.cs (2)
157
builder.MapPost("/api/todos", (
Todo
todo) => { });
210
private void ActionWithCustomBinder([ModelBinder(BinderType = typeof(CustomBinder))]
Todo
model) { }
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.RequestBody.cs (6)
403
builder.MapPost("/form", ([FromForm]
Todo
todo) => { });
552
private void ActionWithFormModel([FromForm]
Todo
todo) { }
562
builder.MapPost("/form", ([FromForm]
Todo
todo, [FromForm] Error error) => { });
690
private void ActionWithMultipleFormModel([FromForm]
Todo
todo, [FromForm] Error error) { }
951
builder.MapGet("/api/", ([FromForm]
Todo
todo, IFormFile formFile, [FromForm] Guid guid) => { });
1076
private void ActionWithMixedFormTypes([FromForm]
Todo
todo, IFormFile formFile, [FromForm] Guid guid) { }
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Responses.cs (4)
97
.WithMetadata(new ProducesResponseTypeMetadata(StatusCodes.Status200OK, typeof(
Todo
), ["application/json"]))
122
.WithMetadata(new ProducesResponseTypeMetadata(StatusCodes.Status200OK, typeof(
Todo
), ["application/json", "application/xml"]));
152
.WithMetadata(new ProducesResponseTypeMetadata(StatusCodes.Status200OK, typeof(
Todo
), ["application/xml"]));
256
.WithMetadata(new ProducesResponseTypeMetadata(StatusCodes.Status200OK, typeof(
Todo
), ["application/json"]));
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (7)
24
builder.MapPost("/", (
Todo
todo) => { });
128
builder.MapPost("/required-poco", ([Required]
Todo
todo) => { });
129
builder.MapPost("/non-required-poco", (
Todo
todo) => { });
130
builder.MapPost("/required-form", ([Required][FromForm]
Todo
todo) => { });
131
builder.MapPost("/non-required-form", ([FromForm]
Todo
todo) => { });
240
builder.MapPost("/enumerable-todo", (IEnumerable<
Todo
> todo) => { });
241
builder.MapPost("/array-todo", (
Todo
[] todo) => { });
Services\OpenApiSchemaService\OpenApiSchemaService.ResponseSchemas.cs (6)
152
static
Todo
? GetTodo() => Random.Shared.Next() < 0.5 ? new Todo(1, "Test Title", true, DateTime.Now) : null;
276
builder.MapGet("/api", () => new Result<
Todo
>(true, new TodoWithDueDate(1, "Test Title", true, DateTime.Now, DateTime.Now.AddDays(1)), null));
447
builder.MapGet("/", () => TypedResults.Ok<List<
Todo
>>([new Todo(1, "Test Title", true, DateTime.Now), new Todo(2, "Test Title 2", false, DateTime.Now)]));
494
builder.MapGet("/", () => TypedResults.Ok<PaginatedItems<
Todo
>>(new(0, 1, 5, 50, [new Todo(1, "Test Title", true, DateTime.Now), new Todo(2, "Test Title 2", false, DateTime.Now)])));
706
[ProducesResponseType(typeof(
Todo
), StatusCodes.Status200OK)]
707
internal
Todo
Get() => new(1, "Write test", false, DateTime.Now);
Transformers\Implementations\OpenApiSchemaReferenceTransformerTests.cs (12)
73
builder.MapPost("/api", (
Todo
todo) => TypedResults.Ok(todo));
126
builder.MapPost("/api", (
Todo
[] todo) => { });
127
builder.MapPost("/api-2", (Dictionary<string,
Todo
> todo) => { });
183
builder.MapPost("/api", (IFormFile resume, [FromForm]
Todo
todo) => { });
184
builder.MapPost("/api-2", ([FromForm] string name, [FromForm]
Todo
todo2) => { });
219
builder.MapPost("/api", (IEnumerable<
Todo
> todo) => { });
220
builder.MapPost("/api-2", (
Todo
[] todo) => { });
273
builder.MapPost("/todo", (
Todo
todo) => { });
279
if (context.JsonTypeInfo.Type == typeof(
Todo
) && context.ParameterDescription is not null)
309
builder.MapPost("/api-3", (
Todo
todo) => { });
361
public ICollection<
Todo
> Todos { get; set; } = [];
464
if (context.JsonTypeInfo.Type == typeof(
Todo
))
Transformers\SchemaTransformerTests.cs (20)
19
builder.MapPost("/todo", (
Todo
todo) => { });
33
Assert.Equal(typeof(
Todo
), context.JsonTypeInfo.Type);
47
Assert.Equal(typeof(
Todo
), context.JsonTypeInfo.Type);
81
Assert.Equal(typeof(
Todo
), context.JsonTypeInfo.Type);
150
builder.MapPost("/todo", (
Todo
todo) => { });
178
builder.MapPost("/todo", (
Todo
todo) => { });
184
if (context.JsonTypeInfo.Type == typeof(
Todo
))
208
builder.MapPost("/todo", (
Todo
todo) => { });
214
if (context.JsonTypeInfo.Type == typeof(
Todo
) && context.ParameterDescription is not null)
238
builder.MapPost("/todo", (
Todo
todo) => { });
261
builder.MapPost("/todo", (
Todo
todo) => { });
285
builder.MapPost("/todo", (
Todo
todo) => { });
323
builder.MapPost("/todo", (
Todo
todo) => { });
360
builder.MapPost("/todo", (
Todo
todo) => { });
386
builder.MapPost("/todo", (
Todo
todo) => { });
412
builder.MapPost("/todo", (
Todo
todo) => { });
515
builder.MapGet("/list-of-todo", () => new List<
Todo
> { new Todo(1, "Item1", false, DateTime.Now) });
674
builder.MapPost("/todo", ([FromForm]
Todo
todo, [FromForm] Error error) => { });
714
if (context.JsonTypeInfo.Type == typeof(
Todo
))
850
if (context.JsonTypeInfo.Type == typeof(
Todo
))
Transformers\TypeBasedTransformerLifetimeTests.cs (1)
349
if (context.JsonTypeInfo.Type == typeof(
Todo
))