Skip to content
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

Merged
merged 6 commits into from
Dec 10, 2024
Merged

Conversation

mikekistler
Copy link
Contributor

This PR adds summaries, descriptions, and tags to the Catalog API endpoints and descriptions on all parameters and properties.

Copy link
Member

@captainsafia captainsafia left a 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")]
Copy link
Member

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,
Copy link
Member

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. 🤔

@mikekistler mikekistler merged commit aaf1857 into main Dec 10, 2024
4 checks passed
@mikekistler mikekistler deleted the mdk/openapi-metadata branch December 10, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants