-
Notifications
You must be signed in to change notification settings - Fork 14
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
Automatically-generated API console (HTML forms/views) #1
Comments
Suggestion: Implement this by allowing the API client to request a description of each model. This will allow the client to automatically build an API console. You could simply include an HTML/JavaScript app in rest_gae that implements this entirely client-side. |
Sounds like a good idea - but when you say "request a description of each model" - how would that be implemented? A new kind of endpoint? What's the "correct" way for RESTful APIs? |
I'm not sure there is a specific "correct" RESTful way to do this. I've seen it done by adding a new resource type that you can query. For example, you could |
Interesting idea - I think I'll implement it in a similar fashion... Thanks :-) |
Another suggestion - just doing |
Also a good idea - but we'll need to let the user define the URL that will be used for querying that info |
Another way of exposing the models: |
I hadn't considered using OPTIONS. For reference, here's some arguments both for and against it: I'm convinced that it's a pretty good idea. Here's another unrelated suggestion: If the model has a docstring, include it in the OPTIONS description. That would help allow the automatic generation of API docs. |
Also, for the description format itself, this is worth a look: http://json-schema.org/examples.html The example alone tells me that it will probably suit our needs. I haven't dug too deeply into the standard, so it might turn out to be a bit of a bloated monster like XML schema. |
Used while developing - similar to what djagno-rest-framework has.
The text was updated successfully, but these errors were encountered: