-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
3874 V4 API Documentation #4235
Conversation
Sorry to take a little time reviewing this. Code-wise this is great, nice solution, but when this merges, we'll officially launch v4, so we need to do some more work to get the remaining pages ready before then. The migration guide is a nice-to-have. It'd be nice to launch v4 with that in place, but before we merge this, we at least need to update the documentation so that the v4 documentation is 100% correct for all the changes we've made. I think this might be a good step for @s-taube to work on, to get this over the line and merged. That will officially launch the new API, and then it'll just be about turning off the old Solr stuff, and migrating people to the new one. So: This looks good and is safe to merge, but we want to add to it before we do. Thanks Alberto. |
Removed "human" from "human editors" per Mike's request.
Removed "performance tip" number 1, per Mike's request.
Removed "count" field
Removed "count" fields
Removed "count" field
@albertisfu , I was going to update the example results on the search api page, because some of the fields in the given example have changed or been removed. For example, under “Basic Usage,” the returned results are for However, when I try to get v4 results via the link https://www.courtlistener.com/api/rest/v4/search/?q=foo, Do you have any guidance on what updates should be made (if any) to the results under “Basic Usage” on the search API page? |
Yeah, in this case, I see that the page you're editing is You can find the example results here: https://www.courtlistener.com/api/rest/v3/search/?q=foo Here is an example:
As you can see, the following fields are not present: source, status_exact, non_participating_judge_ids, pagerank, and caseNameShort. There is also a new field: date_created, as described in the migration guide. For V4, the example can be extracted from the link you shared: The difference from V3, is that |
@s-taube, I think you should be marked as staff in CL, but let me know if not. |
On v3 API pages, we want to let people know v4 is now available. And on v4 pages, we want to link people back to v3 in case they didn’t migrate yet. @albertisfu, on api/rest/v3, can you add an alert that links people to the latest version? (I assume you would have made this change anyway, for consistency with api/rest/v2 and api/rest/v1, which both have the alert “These notes are for a version of the API that has been deprecated...please use the latest version...") At the top of rest-docs-vlatest, I just added an alert that links people back to the change log in case they want to access v3 documentation. |
@s-taube Of course, I’ve added the alert you mentioned: This alert links to Just one question: You mentioned this alert should also appear on On
If we add this response now, v3 will be disabled completely. However, could we add an additional key to the v3 endpoints response to alert users about its future deprecation?
Would this be helpful? @mlissner |
v3 isn't going to be deprecated particularly soon, so On the warning, I think a better message is:
I'd love to disable v3, but it's going to take a very long time. The best we can really do is switch v3 of search over to Elastic with some minor breakage. |
Great! I've updated the warning message: Since we don’t have a |
@albertisfu I won't add a separate PR, and yes, create the view in this one. |
Sure, I've added the migration guide view and template. It's available at The template is I’ve linked this page in the V3 docs warning message. Let me know if anything else is needed. |
Thanks Alberto. Would it make more sense to put the migration guide in the v4 namespace? Maybe Also, do you think you could convert the Google doc to HTML and put it in the guide? I think you'll have a better chance of getting all the details right, since you've got proper HTML editors and such? |
Of course. I'll apply these changes. |
@s-taube I've added the V4 API Migration Guide HTML along with its Table of Contents based on the Google document we have. It's located at I believe we just need to set the date, which currently appears as: XXXDATEXXX. Let me know if any additional adjustments are needed. |
I know we're not done yet, but I'm really excited to be pushing this out. Thank you both! |
According to our talk, I have added support to handle version 4 of the API.
VersionedTemplateView
which takes the version from the URL and uses it to select the template according to the version. It also passes the version to the context. So we can avoid duplicated templates when this is the only change.Most endpoints now use the same template
-vlatest.html
, and only the version changes within the template where required or rendered.In case we need to create a custom template for an endpoint to notice differences between
v3
andv4
, that can be done by creating a template for v3, for instance:search-api-docs-v3.html
, and usingsearch-api-docs-vlatest.html
for v4. Like the search case where for now, I copied the HTML ofsearch-api-docs-v3.html
tosearch-api-docs-vlatest.html
.The other template that I copied was the base API template. I created
rest-docs-v3.html
andrest-docs-vlatest.html
can be used to describe changes forv4
.Let me know if additional tweaks are required.