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

REST results should be discoverable #1071

Open
mpdehaan opened this issue Mar 31, 2022 · 3 comments
Open

REST results should be discoverable #1071

mpdehaan opened this issue Mar 31, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@mpdehaan
Copy link

A big thing to REST API proponents is discoverability. In addition to having the API index like

/api

{
    'characters':  '/dev/api/characters', 
    'scenes' : '/dev/api/scenes',
    'jokes' : '/dev/api/jokes'
}

when you get back a /dev/collection result, we should fill in the objects with the URLs to their resources:

{ id: UUID, name: "roger", occupation: "shrubber",  _href: "/dev/characters/UUID" }

This means when you pass around the object you don't have to construct the URL to the object programatically, which is important because the URL of an object may change in the application, and then the code that calls it (the client) doesn't have to hunt through the application code to make updates.

The general rule of developing REST client applications is you don't build any client URLs, you first fetch /api and then look up the URLs to the collections by name, and so on.

This makes it super easy for someone to build a client app talking to the API because they can kind of surf around and discover what the API structure looks like, without having to ask backend devs.

@mpdehaan mpdehaan added the enhancement New feature or request label Mar 31, 2022
@penberg
Copy link
Contributor

penberg commented Apr 4, 2022

Related to #25

@penberg
Copy link
Contributor

penberg commented Apr 21, 2022

We now have OpenAPI support to show endpoint paths. To make the results discoverable, we first need an API for developers to describe the endpoint results, and then make them appear in the generated OpenAPI specification.

@mpdehaan
Copy link
Author

I think I reopened the other one and I see this is still open, so I'm going to fix my activity on the other ticket, sorry for confusion.

Did want to clarify that we still want the REST routes to appear at "/dev" in a user friendly way like the above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants