scramble is a free, open source api development & testing project written in PHP and released under MIT. It has 2,209 GitHub stars, 206 forks and 16 open issues, and was last pushed 3 hours ago. On this registry it ranks #98 of 178 tracked projects in API Development & Testing, with 5 head-to-head comparisons available.

What is scramble?

Scramble is a Laravel package that generates OpenAPI 3.1.0 API documentation directly from application code, without requiring PHPDoc annotations, and it is built for Laravel developers and teams who need documentation that stays in step with the code they ship.

What it is

Scramble lives in the PHP and Laravel ecosystem and is distributed as a Composer package under the name dedoc/scramble. It reads the application itself and produces a machine-readable OpenAPI document describing the API, then exposes that document to humans and tools. Once installed, it adds two routes to the application: /docs/api serves a UI viewer for the documentation, and /docs/api.json serves the same content as an OpenAPI document in JSON format.

The concrete problem it solves is documentation drift. The usual approach requires a developer to annotate every possible parameter and field by hand, and the project's stated motto is that generating documentation from code removes that chore. Hand-written annotations are the thing being replaced here. Because every annotation has to be written and then kept in sync, the documentation quietly becomes outdated and stops being trustworthy. Scramble generates from the code instead, so the published API description reflects what the application actually declares, and developers spend their attention on code rather than on annotation upkeep.

Key capabilities

  • Generates documentation in OpenAPI 3.1.0 format rather than a proprietary schema.
  • Produces an OpenAPI document without requiring PHPDoc annotations anywhere in the codebase.
  • Serves a browsable UI viewer at the /docs/api route after installation.
  • Serves the raw JSON OpenAPI document at the /docs/api.json route for consumption by other tools.
  • Installs through Composer with composer require dedoc/scramble, with no separate build step named in the README.
  • Restricts both routes to the local environment by default, so documentation is not exposed by accident.
  • Allows that restriction to be changed by defining a viewApiDocs gate, which is the documented mechanism for authorising access.

Who uses it and how

  • Laravel teams building API-first backends use it as the in-application source of truth for endpoint descriptions, rather than maintaining annotation blocks by hand.
  • Teams whose hand-written annotations have fallen behind the code adopt generation so the published schema tracks the current implementation.
  • Developers working locally open /docs/api to read and browse the API while building against it.
  • Teams that want documentation reachable outside local define the viewApiDocs gate and control who may open the routes in staging or production.
  • Tooling and integrations consume /docs/api.json as the JSON OpenAPI document, since the format is the standard one rather than a Scramble-specific one.

Getting started

Install the package with composer require dedoc/scramble. After installation the two routes are available, and the full documentation lives at scramble.dedoc.co.

How it compares

The facts provided list no paid products that this project replaces, and they name no similar tools either, so Scramble stands alone in this registry. There is nothing in the supplied material on which to build a comparison against other documentation generators.

When to use it — and when not to

Because it is a package inside an existing Laravel application rather than a separate service, the operator must already run a Laravel application; nothing in the README points to an additional database, storage layer, or mail service to stand up. Anyone not on Laravel, or anyone who wants to hand-control every description and example in the schema, should look elsewhere. The honest weakness is the README itself: the excerpt is brief and defers almost everything to the external documentation site, so expect to read that site rather than the repository to learn the details.

project readme (upstream, from github) — read inline

Scramble

Scramble generates API documentation for Laravel project. Without requiring you to manually write PHPDoc annotations. Docs are generated in OpenAPI 3.1.0 format.

Documentation

You can find full documentation at scramble.dedoc.co.

Introduction

The main motto of the project is generating your API documentation without requiring you to annotate your code.

This allows you to focus on code and avoid annotating every possible param/field as it may result in outdated documentation. By generating docs automatically from the code your API will always have up-to-date docs which you can trust.

Installation

You can install the package via composer:

composer require dedoc/scramble

Usage

After install you will have 2 routes added to your application:

  • /docs/api - UI viewer for your documentation
  • /docs/api.json - Open API document in JSON format describing your API.

By default, these routes are available only in local environment. You can change this behavior by defining viewApiDocs gate.


Frequently asked questions

Is scramble free to use?

scramble is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does scramble do?

Modern Laravel OpenAPI (Swagger) documentation generator. No PHPDoc annotations required.

What is scramble written in?

scramble is primarily written in PHP. Its source is publicly available at https://github.com/dedoc/scramble, and it has 2,209 GitHub stars.