I'm working on a GET API in dotnet and I've been trying to document the query parameter being passed which is an aggregate object for the pagination of results (page size and page number). Comments/documentation for get method:
/// <param name="Id">ID used to identify a record</param> /// <param name="paginationParams">Request object that contains the pagination parameters <inheritdoc cref="PaginationParameters"/></param> As you can see above, I'm referring to the PaginationParameters aggregate object/model. Now, this doesn't seem to be working correctly, or has no affect as I can change the field to [Required] and the swagger then reflects that. However, it's worth noting the ID field is documenting fine.
Below is the method signature for the get method:
public async Task<IActionResult> GetStuff( [FromHeader][BindRequired] int Id, [FromQuery] PaginationParameters paginationParams) Finally, my model is as of below:
/// <summary> /// Pagination parameters /// </summary> public class PaginationParameters { /// <summary> /// PageNumber /// </summary> [Required] public int? PageNumber { get; set; } = null; /// <summary> /// PageSize /// </summary> [Required] public int? PageSize { get; set; } = null; } It's driving me up the wall that it's not working and I'm sure it would be a simple fix, it just seems to be ignoring my descriptions for page size and page number.