← All Learning Paths

API Documentation

Document APIs people can use: contracts, examples, deprecation, and SDK ergonomics.

technicalintermediate9 nodes12.33h total

Learning path

Document APIs people can use: contracts, examples, deprecation, and SDK ergonomics.

  1. Run "Deprecate an API endpoint without breaking clients that have not migrated yet." from "Add API Deprecation Headers" and confirm the documented result "Every legacy response carries the three headers.".

    Completion criteria: Show the command for every step of "Add API Deprecation Headers" and paste the output proving "Deprecate an API endpoint without breaking clients that have not migrated yet."; then note the step where "Every legacy response carries the three headers." appears.

    Next step: Add an OpenAPI Contract Test

    ⏱ 0.5h

  2. Apply "Add an OpenAPI Contract Test" to a api documentation task, checking that "The document passes lint with no errors and a documented ruleset." appears after the "Detect breaking API changes and undocumented responses before a deploy, using the OpenAPI" step.

    Prerequisites: Add API Deprecation Headers

    Completion criteria: Run "Add an OpenAPI Contract Test" twice — once as written and once with a changed input — and attach both transcripts with the observed difference.

    Next step: Review API Contract Changes Before Merge

    ⏱ 0.5h

  3. Use "Review API Contract Changes Before Merge" to decide "The diff is attached to the pull request and reviewed.", then prove the outcome with "Prevent an API change from breaking consumers silently, while allowing compatible evolution".

    Prerequisites: Add an OpenAPI Contract Test

    Completion criteria: Deliver a transcript of "Review API Contract Changes Before Merge" with each step's command and observed state, ending at "Prevent an API change from breaking consumers silently, while allowing compatible evolution".

    Next step: Zod

    ⏱ 0.5h

  4. Wire "Zod" into a scratch api documentation project, following "z.object z.object(shape: ZodRawShape, params?: ZodObjectParams): ZodObject", and record one working request/response pair.

    Prerequisites: Review API Contract Changes Before Merge

    Completion criteria: Run a request against "Zod", paste the response, and add one deliberately invalid call with its error.

    Next step: FastAPI

    ⏱ 1h

  5. Read "FastAPI"'s documented surface around "Path Parameters @app.get('/items/{item_id}') def read_item(item_id: int): ...", then build a minimal endpoint and log the response.

    Prerequisites: Zod

    Completion criteria: Attach one successful call and one invalid call against "FastAPI", citing "Path Parameters @app.get('/items/{item_id}') def read_item(item_id: int): ..." as the documented surface.

    Next step: Express

    ⏱ 1h

  6. Stand up "Express" for a api documentation task, confirm "Router express.Router(options?: RouterOptions): Router" holds, and document one failure you triggered.

    Prerequisites: FastAPI

    Completion criteria: Run a request against "Express", paste the response, and add one deliberately invalid call with its error.

    Next step: API Design Principles for Long-lived Systems

    ⏱ 1h

  7. Compare "Pagination: One Consistent Way to Page" with "Idempotency: Retries Must Not Duplicate Work" in "API Design Principles for Long-lived Systems" and state which trade-off you would accept in api documentation code.

    Completion criteria: Attach a decision log for "API Design Principles for Long-lived Systems": the "Pagination: One Consistent Way to Page" section, one rejected alternative, and the diff of the file you changed.

    Next step: Lint Heading Structure in API Docs

    ⏱ 1h

  8. In the "API Documentation" path, implement "Lint Heading Structure in API Docs" so JSON object: { markdown: string } yields [2:heading-jump:h1->h3,4:duplicate-heading:usage], including the second sample's edge case.

    Completion criteria: Attach the solution file for "API Documentation", two passing sample runs, and one failing run whose error matches the contract.

    Next step: Capstone: API Documentation

    ⏱ 0.33h

  9. Ship "Schema parser" from "Build a Schema Registry Service", then prove it with the project's test suite and an acceptance note.

    Prerequisites: Lint Heading Structure in API Docs

    Completion criteria: Deliver "Schema parser" and paste the test output where the acceptance test passes; include the test name and command.

    Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.

    ⏱ 4h