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

Document process for "Preview" API endpoint usage #816

Closed
bitwiseman opened this issue May 18, 2020 · 3 comments
Closed

Document process for "Preview" API endpoint usage #816

bitwiseman opened this issue May 18, 2020 · 3 comments

Comments

@bitwiseman
Copy link
Member

bitwiseman commented May 18, 2020

We need to document how the project supports using "Preview" API endpoints, including @Preview, @Deprecated, withPreview(), and the Previews class.

Also all @Preview items should include a link of GitHub documentation of what they are previewing and @deprectated JavaDoc field with boiler plate explaining that this feature is still in preview and a link to the same documentation.

@bitwiseman
Copy link
Member Author

These are preview api:
https://docs.github.com/en/free-pro-team@latest/rest/overview/api-previews

API previews let you try out new APIs and changes to existing API methods before they become part of the official GitHub API.

During the preview period, we may change some features based on developer feedback. If we do make changes, we'll announce them on the developer blog without advance notice.

To access an API preview, you'll need to provide a custom media type in the Accept header for your requests. Feature documentation for each preview specifies which custom media type to provide.

To see examples of how previews work in this library, look at any method that uses the withPreview() method such as:

/**
* Obtain an installation associated with this app.
* <p>
* You must use a JWT to access this endpoint.
*
* @param id
* Installation Id
* @return a GHAppInstallation
* @throws IOException
* on error
* @see <a href="https://developer.github.com/v3/apps/#get-an-installation">Get an installation</a>
*/
@Preview(MACHINE_MAN)
@Deprecated
public GHAppInstallation getInstallationById(long id) throws IOException {
return root.createRequest()
.withPreview(MACHINE_MAN)
.withUrlPath(String.format("/app/installations/%d", id))
.fetch(GHAppInstallation.class)
.wrapUp(root);
}

@bitwiseman
Copy link
Member Author

Related #1003

@bitwiseman
Copy link
Member Author

Almost all previews have be graduated. There is a new system for API versioning in GithHub. We will need to do something similar to this issue for the new scheme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant