-
Notifications
You must be signed in to change notification settings - Fork 1
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
OpenAPI docs are wrong for /api/v1/CoffeeCards #75
Comments
Seems like you are right. The wrong type is documented at https://github.com/AnalogIO/analog-core/blob/develop/coffeecard/CoffeeCard.WebApi/Controllers/CoffeeCardsController.cs#L36 [HttpGet]
[ProducesResponseType(typeof(CoffeeCardDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
public ActionResult<CoffeeCardDto> Get()
{
return Ok(_ticketService.GetCoffeeCards(User.Claims));
} I think we are deprecating this API in v2, so maybe this is not worth spending time on. |
Wasn't sure whether we would continue using this endpoint, or the ticket's one, which is why I filed the issue. In either case, it is a very easy fix |
I understand. It's worth a discussion what is the optimal API for Tickets, Purchases and CoffeeCards. They are a bit mixed today and we can probably improve this in API v2. |
The way I see it, it partially comes down to where do we want the computation to take place, i.e. in the app or the database. The coffeecard endpoint gives more work to the database, in that it is a bigger query compared to the one from tickets. For the tickets one, on the other hand, we have to group the tickets by their product category in the app once we receive them. Neither of them are perfect, since the app doesn't really need to know which tickets a user has in the database, so it gets redundant data in the tickets' endpoint. Similarly, the app doesn't really need to know which products it does not have tickets for, so it also gets redundant data in the cofeecard one |
The OpenAPI doc says it returns a single CoffeeCard, though it returns an IEnumerable of CoffeeCards
The text was updated successfully, but these errors were encountered: