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