-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OpenAPI metadata to Catalog API endpoints #631
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Had a question inline to jog my memory about why we're not using ProducesProblem
.
.WithDescription("Get a list of catalog items for the specified brand") | ||
.WithTags("Brands"); | ||
api.MapGet("/catalogtypes", | ||
[ProducesResponseType<ProblemDetails>(StatusCodes.Status400BadRequest, "application/problem+json")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remind me again why we're not using .ProducesProblem(StatusCodes.Status400BadRequest, "application/problem+json")
?
public record PaginationRequest( | ||
[property: Description("Number of items to return in a single page of results")] | ||
[property: DefaultValue(10)] | ||
int PageSize = 10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm....we should probably support default parameter values instead of relying on the attribute as well. 🤔
This PR adds summaries, descriptions, and tags to the Catalog API endpoints and descriptions on all parameters and properties.