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

Refactor Catalog API #659

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Refactor Catalog API #659

wants to merge 5 commits into from

Conversation

mikekistler
Copy link
Contributor

This PR refactors the Catalog API to adopt more commonly accepted REST API conventions.

Fixes #589.

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.

Left some comments inline!

Do we want to create a new API version for the catalog API and make these changes in a new version of this API? It would be a good way to dogfood the versioning experience.

api.MapPost("/items", CreateItem)
.WithName("CreateItem")
.WithSummary("Create a catalog item")
.WithDescription("Create a new item in the catalog");
api.MapPut("/items/{id:int}", UpdateItem)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to retain the Items tag on this and the other items-related endpoints?

{
var pageSize = paginationRequest.PageSize;
var pageIndex = paginationRequest.PageIndex;

var totalItems = await services.Context.CatalogItems
var root = (IQueryable<CatalogItem>)services.Context.CatalogItems;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the cast to IQueryable<CatalogItem> here?

.LongCountAsync();

var itemsOnPage = await services.Context.CatalogItems
.OrderBy(c => c.Name)
var itemsOnPage = await root
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the ordering-by-name as removed here. Do we want to keep that?

@@ -64,64 +64,10 @@
}
]
},
"route4": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep the api-version query parameter here?

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.

Refactor Catalog API
2 participants