|
Presumably you use a query parameter to act on the resource being filtered and the query parameter indicates both that filtering is happening and the resource being used to achieve that filter
|
![]() |
|
![]()
|
# ? Feb 14, 2025 08:47 |
|
HoboMan posted:ok, again i have not had to design poo poo before. your /foo/bar resource would return a link to /wangs?of=/foo/bar or something like that.
|
![]() |
|
URLs are not ids any more than pointers are ids
|
![]() |
|
used the object id then, whatever. point is the parent resource contains links to what you need.
|
![]() |
|
Sapozhnik posted:URLs are not ids any more than pointers are ids RFC 3986 would beg to disagree. quote:A Uniform Resource Identifier (URI) provides a simple and extensible means for identifying a resource. quote:The term "Uniform Resource Locator" (URL) refers to the subset of URIs that, in addition to identifying a resource, provide a means of locating the resource by describing its primary access mechanism (e.g., its network "location").
|
![]() |
|
HoboMan posted:ok, again i have not had to design poo poo before. https://yourdumbservice.com/the-first-resource?the-second-resource=1
|
![]() |
|
necrotic posted:your /foo/bar resource would return a link to /wangs?of=/foo/bar or something like that. wtf if you're using dotnet then you can bind variables out of the url so you can have foo\123\butt\456 and in your controller get fooid as 123 and buttid as 456 you just gotta decorate your controller base route and actions with a binder like foo\{int:fooid} \butt\{int:buttid} edit: I'm not really sure if that's what you mean but you can also use redirects to actions to hit an endpoint, do something, get the value returned and redirect to another that performs another action off that returned value
|
![]() |
|
Powerful Two-Hander posted:wtf I think the debate is over how RESTful that API is for the usecase. Maybe OP should clarify the use case a little?
|
![]() |
|
ComradeCosmobot posted:I think the debate is over how RESTful that API is for the usecase. Maybe OP should clarify the use case a little? yeah he said restful not hierarchical
|
![]() |
|
HoboMan posted:ok, again i have not had to design poo poo before. Assuming you're just trying to GET all of the resources that "contain", for lack of a more generic word, some other resource. In other words, searching for all resources that have some property that matches another resource. I'd probably use one of two options depending upon what your actual use-case is. First would be a query param on the route for the resource: /api/butts?kissed_by=[goon_id] My alternative would be swapping the resources and use a nested route of the single resource by which you're trying to search: /api/goons/:goonId/kissed_butts I'd only use the latter if there's an obvious hierarchical relationship between resources. Like, if Bars only exist as children of Foos, then the latter would work (/foos/:fooId/bars). In basically any other case, like if Foos and Bars might be associated but could be coexistent without requiring the other, then I'd go with a query parameter. The latter is also probably not strict REST but the internet is full of awful blog posts about how to do REST correctly and all of them have different opinions so I have no loving idea.
|
![]() |
|
sounds like you need graphql OP. or possibly SOAP
|
![]() |
|
um pretty sure it's time to create a dsl to handle this for maximum flexibility, unless you can make do with OData (aka the Best Way to REST).
|
![]() |
|
I'm still not sure what the OP is trying to do. Is the filtering between any two arbitrary services? What even is the use case?
|
![]() |
|
it's good to see that even if people don't understand the use case or even its most basic requirements they won't hesitate to suggest solutions that may or may not address the problem developers.txt
|
![]() |
|
OP definitely needs SOAP. SOAP makes everything better.
|
![]() |
|
Sagacity posted:it's good to see that even if people don't understand the use case or even its most basic requirements they won't hesitate to suggest solutions that may or may not address the problem
|
![]() |
|
yeah it's, as pseudorandom suggested, get all butts kissed by a given goon
|
![]() |
|
we just had our architect copy and paste a random blog post* about RESTfulness into our confluence and announce 'start doing this now' becoming standards document #9801293 that has no relation to our codebase whatsoever and probably never will lol *it had to the gall to quote roy fielding's dissertation just for a random pull quote about 'URL == resource' yet the rest of the article ignores any important parts of rest and just talks about underscores vs hyphens and poo poo
|
![]() |
|
sounds like every other "restful design doc" ive ever seen
|
![]() |
|
does anybody actually use self-documenting features of REST apis? github's api has a million extra annotations on every message and they seem pretty pointless to me
|
![]() |
|
animist posted:does anybody actually use self-documenting features of REST apis? github's api has a million extra annotations on every message and they seem pretty pointless to me sounds about as useful as other forms of "self documenting"
|
![]() |
|
animist posted:does anybody actually use self-documenting features of REST apis? github's api has a million extra annotations on every message and they seem pretty pointless to me We produce RAML for our which our customers do seem to use, well they complain when we break it anyway. I made a toy app that uses the RAML to create a visualisation of all the data in the system which is quite cool.
|
![]() |
|
animist posted:does anybody actually use self-documenting features of REST apis? github's api has a million extra annotations on every message and they seem pretty pointless to me I spent quite a long tine trying to generate swagger from http4s routes, or generating them from a swagger spec file, never really made any progress though.
|
![]() |
|
animist posted:does anybody actually use self-documenting features of REST apis? github's api has a million extra annotations on every message and they seem pretty pointless to me I've used it to scrape data off apis backing website frontends
|
![]() |
|
swagger generation in .net is super easy. just add the swashbuckle package
|
![]() |
|
swashbuckle is fuckin fantastic and the swagger api docs i had on a tool at lastjob were probably my group's most widely used documentation and definitely the most used per hour spent writing
|
![]() |
|
idk why anyone would bother with something other than .net for web stuff
|
![]() |
|
animist posted:does anybody actually use self-documenting features of REST apis? github's api has a million extra annotations on every message and they seem pretty pointless to me we're merging with a different company in the same sector and their cto was very excited to tell me that they've started doing the full HATEOAS thing with their new microservice architecture. july is gonna be a fun month
|
![]() |
|
yeah swagger works out of the box with e.g. play, just not http4s
|
![]() |
|
florida lan posted:OP definitely needs SOAP. SOAP makes everything better. just lol at the idea of goons using SOAP
|
![]() |
|
i think i'm getting gaslit by my dev tools literally cant tell what is real anymore
|
![]() |
|
HoboMan posted:i think i'm getting gaslit by my dev tools I wonder if there's a way to have preprocessor macros that change behavior depending on the time of day or calendar day the build is occurring builds that only work m-f 9-5 with a 30 minute break for lunch builds that produce different output on April 1 and/or April 20
|
![]() |
|
make can read system environment variables and it can change the values of preprocessor macros with command line arguments to gcc only step remaining is some job running in the background to update the environment variables based on current datetime
|
![]() |
|
HoboMan posted:i think i'm getting gaslit by my dev tools we’re terrible programmers, not dev tools
|
![]() |
|
Progressive JPEG posted:I wonder if there's a way to have preprocessor macros that change behavior depending on the time of day or calendar day the build is occurring RPATDO_LAMD posted:make can read system environment variables and it can change the values of preprocessor macros with command line arguments to gcc gcc posted:__DATE__
|
![]() |
|
i was hoping this wasn't a real domain and now i am contemplating buying it
|
![]() |
|
rest is dumb and bad asking here rather than the PL thread, but what are git submodules and why are they so bad?
|
![]() |
|
redleader posted:rest is dumb and bad git submodules are where one git repo includes a pointer to specific commit in another git repo, that gets checked out inside the main one as a directory in theory they’re a nice way of breaking up a giant repo into logical chunks in a manageable way in practice they’re a tire fire and massive pain in the rear end to keep up to date. imo this is mainly a tooling problem, but git devs would do diy dentistry than make a sensible UI decision so it’ll never get any better
|
![]() |
|
what if your git repo could incorporate by reference other git repos? and what if each of those git repos could do the same thing?! and what if none of it worked reliably, you constantly fought with stupid recursive git commands, and you came to wish that you'd just written and checked-in a five line shell script containing some git commands instead?
|
![]() |
|
![]()
|
# ? Feb 14, 2025 08:47 |
|
there are multiple layers of badness to it. git does not handle submodules well at all. from top to bottom it is way more of a pita than it should be. SVN linked repos were easier to work with ffs. people also largely use them for lazy, ad-hoc dependency management in a way that's awful, fragile and stupid. Arcsech posted:in theory theyre a nice way of breaking up a giant repo into logical chunks in a manageable way yes, this is effectively ad hoc dependency management and you're basically 100% always better off doing it whatever the "right way" is for your lang/environment
|
![]() |