PromptsReviewed · GitHub

Document API: GitHub Copilot prompt

Document API is a GitHub Copilot prompt for developers documenting REST APIs, but its prompt-file support is in public preview. It requests OpenAPI 3.0.3 YAML from endpoint code, covering parameters, request and response models, examples, reusable components and authentication.

Researched 15 Nov 2026

In short.

Document API is a GitHub Copilot prompt for developers generating REST API documentation, but the page does not demonstrate that its output is valid or accurate. It provides instructions for producing OpenAPI 3.0.3 YAML and narrowing the task to particular endpoints. The checklist covers API metadata, paths, parameters, request bodies, responses, reusable models and security definitions. Prompt files are described as public preview and available in VS Code, Visual Studio and JetBrains IDEs; the supplied usage steps cover VS Code. Costs, licensing terms and measured output quality are unknown.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage is the complete Document API documentation page at [https://docs.github.com/api/article/body?pathname=/en/copilot/tutorials/customization-library/prompt-files/document-api], including the public-preview and editor-availability notice, embedded prompt, setup example and further-reading references. Linked pages and repositories are excluded. Editor behavior, code discovery, generated YAML, validation, runtime agreement and downstream tool compatibility were not assessed; nothing was executed.

The overview

Identity

Document API is a reusable prompt published in GitHub Docs. Its main artifact is the prompt text intended for document-api.prompt.md, which asks GitHub Copilot to turn REST endpoint code into an OpenAPI specification: a machine-readable description of an API.

The original source is [https://docs.github.com/api/article/body?pathname=/en/copilot/tutorials/customization-library/prompt-files/document-api]. The page contains the complete prompt and brief instructions for invoking it.

Assessment

The prompt offers a useful starting checklist for documenting existing REST endpoints. It explicitly requests details that are easy to overlook, including parameter constraints, error responses, reusable models and security requirements.

Its requests for valid, production-ready output are instructions to the assistant, not demonstrated results. The page provides no generated specification, validation receipt or comparison with the underlying API.

Users

It is best suited to developers and API maintainers who have endpoint code available and want an initial OpenAPI document. The endpoint-focus input makes it suitable for documenting one route or a chosen group of routes.

Beginners receive a structured list of what API documentation should contain, but still need to understand the API well enough to review the result. Experienced developers can use the checklist to inspect schema reuse, validation constraints, status codes and authentication.

Capabilities

The prompt requests OpenAPI 3.0.3 YAML with API title, description, version and server configuration. For each operation, it asks for the HTTP method, path, summary, description and organizational tags.

It also requests path and query parameters, request bodies, required and optional fields, success and error response schemas, content types and realistic examples. Reusable models, common parameters, security schemes and applicable security requirements belong in the requested components and operation definitions. These are requested capabilities; their successful generation is not demonstrated.

Using it

Requirements

Following the supplied walkthrough requires VS Code with access to Copilot Chat and endpoint code available for analysis. The page states that Copilot prompt files are available in VS Code, Visual Studio and JetBrains IDEs.

Minimum editor versions, Copilot account eligibility, model requirements, supported programming languages and framework-specific behavior are not specified. Setup instructions for Visual Studio and JetBrains IDEs are not included.

Mechanism

The prompt file uses front matter that sets agent to 'agent' and supplies a description. Its body gives natural-language instructions for analyzing endpoint code and organizing the resulting YAML.

The input expression ${input:endpoint_focus:Which specific endpoint or endpoints should be documented?} asks which endpoints to cover. The page does not explain how code context is collected, whether related files are discovered automatically or how an OpenAPI validator would be invoked.

Setup

Save the supplied prompt content, including its front matter, as .github/prompts/document-api.prompt.md in the project. In VS Code, open Copilot Chat and enter /document-api.

The page says an endpoint can optionally be specified with endpoint_focus=GET /activities. It does not provide installation, sign-in or troubleshooting instructions for Copilot itself.

Example

The page's concrete example is invoking /document-api with endpoint_focus=GET /activities. This asks the assistant to concentrate on that operation when producing the requested specification.

No implementation of GET /activities or resulting YAML accompanies the example. Its actual response fields, status codes, parameters and authentication requirements are therefore unknown; they should come from the implementation rather than the route name.

Assessment & evidence

Limitations

Copilot prompt files are explicitly described as public preview and subject to change. The stated editor availability is limited to VS Code, Visual Studio and JetBrains IDEs.

The source does not establish output validity, endpoint coverage or agreement with runtime behavior. Coverage of behavior defined in middleware, shared validation or external configuration is unknown. The requested realistic examples and error responses also need checking against the actual API.

Reasoning

The prompt's practical value comes from its explicit documentation checklist and endpoint-focus input. These give the assistant a defined output structure and let the developer limit the scope of a generation request.

A valid OpenAPI document and an accurate API description are separate goals. The prompt requests both structured YAML and implementation-specific details, so reviewing syntax alone would not establish that parameters, responses and security rules match the code.

Alternatives

For other community-contributed prompt examples, the page points to Awesome GitHub Copilot Customizations [https://awesome-copilot.github.com]. The linked examples are outside the supplied evidence, so no particular alternative or comparative advantage is established.

Swagger UI, Postman and code generators are named as intended consumers of the resulting specification. They are not presented as alternative implementations of this prompt, and compatibility results are not provided.

Evidence

The evidence consists of the complete GitHub Docs Document API page, including its preview notice, prompt text, usage instructions and further-reading links. The original source snapshot has revision sha256:8f9360ed01f4155a7bcb7e75a77f2b298e1cbc13aebb98b54983da4f372631ca.

The page supports describing the prompt's intended behavior and setup. It supplies no generated artifact, execution output, validator results, benchmark or independent assessment of documentation accuracy. Nothing was executed.

Access & freshness

Costs

The page provides no pricing, subscription eligibility or usage-limit information. The cost of accessing Copilot and using this prompt is unknown from the supplied evidence.

There are no measurements of token consumption, generation time or review effort, so the cost of producing an acceptable specification cannot be estimated from this page.

Rights

The supplied page does not state a license for the prompt or terms for redistributing it. It instructs readers to save the prompt for use, but that does not establish broader redistribution rights.

Rights concerning generated specifications, code supplied as context and any third-party material are not addressed by this source.

Freshness

The supplied page snapshot was captured on 15 November 2026. At that capture, it described Copilot prompt files as public preview and subject to change.

No publication date, last-updated date, editor version or compatibility history is supplied. Availability and behavior beyond the captured statements are unknown.

Actions

Begin with one endpoint whose behavior you understand and supply its implementation as context. Review the resulting paths, parameter constraints, required fields, response schemas, examples and security requirements against the code.

Validate the result as OpenAPI 3.0.3 and check it in the intended Swagger UI, Postman or code-generation workflow before relying on it. The page provides no validation command or demonstrated integration result.

Evidence for this report

selected-page.txtselected · checked 2026-11-15