Scribe
latest
  • Getting Started
  • Scribe 2: What’s new, and how to migrate
  • Migrating from mpociot/laravel-apidoc-generator to Scribe v1
  • Documenting your API
    • Adding general information about your API
    • Specifying metadata about an endpoint
    • Documenting headers for endpoints
    • Documenting query and URL parameters for an endpoint
    • Documenting body and file parameters for an endpoint
    • Documenting responses from an endpoint
    • Excluding endpoints from the documentation
  • Generating Documentation
  • Configuration
  • Troubleshooting and Debugging
  • Customizing the generated documentation
  • How Scribe works
  • Extending functionality with plugins
  • Contributing to Scribe
Scribe
  • Docs »
  • Documenting your API
  • Edit on GitHub

Documenting your API¶

Attention

These docs are for Scribe v2, which is no longer maintained. See scribe.knuckles.wtf/laravel for Scribe v3.

Scribe tries to infer information about your API from your code, but you can enrich this information in the config and by using annotations (tags in doc block comments).

  • Adding general information about your API
    • Authentication information
    • Introductory text
    • Title
    • Logo
  • Specifying metadata about an endpoint
    • Endpoint title and description
    • Grouping endpoints
    • Indicating authentication status
  • Documenting headers for endpoints
  • Documenting query and URL parameters for an endpoint
    • Specifying query parameters
    • Specifying example values
    • Describing URL parameters
  • Documenting body and file parameters for an endpoint
    • The manual way: Specifying body parameters with @bodyParam
    • Using FormRequests
    • Documenting file uploads
  • Documenting responses from an endpoint
    • @response
    • @responseFile
    • Generating responses automatically via response calls
    • @apiResource, @apiResourceCollection, and @apiResourceModel
    • @transformer, @transformerCollection, and @transformerModel
    • How model instances are generated
    • Adding descriptions for fields in the responses

Excluding endpoints from the documentation¶

You can exclude endpoints from the documentation by using the @hideFromAPIDocumentation tag in the method or class doc block. Scribe will not extract any information about the route or add it to the generated docs.

Next Previous

© Copyright 2020, Shalvah Revision 090dfcdd.

Built with Sphinx using a theme provided by Read the Docs.