-
Notifications
You must be signed in to change notification settings - Fork 7
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
Atomic Endpoints - Standardize query parameters (for example in Collections) #15
Comments
In Atomic, I have some logic named "Extended Resources", which deals with the logic above. When fetching any resource, the Classes are checked. If any of these match, a special function is called. For example, if |
Have endpoint-specific propertiesSay we open Things that an endpoint needs to describe:
Parameters need to describe:
Paramaters look a lot like Properties. It's probably a good idea to use these. Collection or new Class?There's a lot of overlap between Collections and Endpoints. Both have a bunch of query parameters, and in many (or all?) usecases, it makes sense to use the same params (pagination, sorting, filtering). Or is a Collection (also) an Endpoint? That actually seems to make a lot of sense, since that fixes the whole discoverability issue of the query parameters. So does every instance of a Collection contain a Multi ClassSay we look at some Collection. We could say that this is both an Endpoint and a Collection. The Of we could have a View switcher, that switches from one registered view to the next one. Would probably result in some sub-optimal UX in some cases. |
Since posting the comments from above, I've actually implemented some endpoints and they can easily be used in the new front-end app. Here's how they work:
I've implemented a There were also a couple of Endpoints that I wanted to do, but didn't because of the current limitations:
How can this be improved upon? Always return EndpointsImagine gettings update: this is what I've used for |
Some resources function like an endpoint: they accept (optional) query parameters which modify the response. A Collection, for example, might use a
page
parameter and asortedBy
parameter. These available query parameters and their datatypes might be standardized.How should the client know if a certain resource has query parameters available? How do we communicate this?
One approach is to make all query parameters available as nested resources in an array, under some new property. Each parameter needs a shortname, a datatype (perhaps default to string), bool whether its optional...
We could also have to property URLs:
requiredParams
andoptionalParams
.The text was updated successfully, but these errors were encountered: