-
Notifications
You must be signed in to change notification settings - Fork 147
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
REST API v1 #429
REST API v1 #429
Conversation
Decided to not return json for server error (status 500) e.a., so that clients are aware that perhaps at some point a json body isn't present - which also might be the case if something breaks really terribly. |
c432fd1
to
48c4b43
Compare
The url used with petstore.swagger.io in doc/API.md is already the one for the master branch here. To test it now, use this link instead. |
d5e734f
to
889f574
Compare
def index | ||
@user = self.current_user | ||
@user = current_user |
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.
I guess it broke since moving current_user
to a concern, this makes it work again.
6fddc88
to
2128548
Compare
2128548
to
22563b0
Compare
5e9fb9f
to
c899933
Compare
One reason I'm not merging this yet, is because a question came up in foodsoft-shop. Now we use If we'd use the model name as the json key ( What do you think? |
i think we should prioritize this PR. even if it doesn't have a complete front end. each time i go to update a rails view or fix bootstrap 2 design stuff it makes me wince. I've fixed many performance issues, most are due to sloppy rails joins that would be better done by front end code. I'll try and give this some time in the next week to review. i did a big api project with spree/solidus so I have some experience with building a rails api. we actually built exactly the same design, a really fast client in angular and rails just for data and server logic. |
in order to ship, i propose you make a milestone for api and split each item in your checklist into an issue in that milestone. easier to submit and comment on that way too |
so that multiple models can be returned, which is relevant when updating group_order_articles.
This can be quite useful for clients, so they don't need to query the order_article separately when updating a group_order_article.
b015124
to
36e79f1
Compare
I'd like to consider merging this soonish! |
It would be nice to make small logical PR out of it first, but keep this here for the overview where it's heading (like I do with the bank transaction stuff) |
do we want to add the foodsoft-shop in this repo too or how do we make sure they stay compatible? |
Ok, I'll split it in the following PRs:
Even though I've packed foodsoft-shop in a Foodsoft plugin (that I'd like to ship within Foodsoft), they should remain working even across versions, as long as the API version is supported. (Even though this might break subtly if the API consumers expect newly introduced attributes to be always present - but at least older API consumers will work with newer Foodsoft versios). |
i want to say think you @wvengen and @paroga - i would love to switch to an api version. i have many improvements to contribute back but they are mixed up with customisation for my coop, keeping the custom stuff in the front-end, where possible, would help a lot. hopefully i get a bit of time to do that in the next month. |
Closing if favour of the 5 other API PRs. |
Starting off from #423, this is a first version of an API for Foodsoft. By design, it only supports user-facing resources, so API users can only see and update one's own orders. Perhaps in a later version of the API, we may add admin-functionality as well.
note this PR will be split into smaller PRs, so don't merge this one
note this feature is finished, but I'd rather wait with merging until foodsoft-shop is ready (or someone else wants to use the API asap); before merging we can still change the api, afterwards I'd be more careful
Pending:
/f
)data
)order_article
togroup_order_article
update endpoint (and maybe others)Doorkeeper::Application
)For later: return all orders, not just open ones (and allow filtering by status)