Skip to content

Fix OpenAPI route generator for Response return contract #520

Closed

Description

@armanist

Summary

install:openapi currently generates route closures that are expected to return Quantum\Http\Response, but one generated closure can reference an undefined $response variable after contract migration.

Problem

In OpenApiCommand::openapiRoutes():

  • The generated docs route closure is migrated to function (): Quantum\Http\Response
  • But if it uses $response->html(...) without receiving/initializing $response, generated code fails at runtime (Undefined variable $response)

Expected behavior

Generated openapi routes should fully comply with the new response contract and return concrete Response objects without undefined variables.

Proposed fix

Update generated route snippets to use helpers that return response instances explicitly:

  • return response()->html(...)
  • return response()->json(...)

Acceptance criteria

  • install:openapi generated docs and spec closures both return Quantum\Http\Response
  • No undefined variable usage in generated routes
  • Generated module routes work under strict response-return middleware/route pipeline

Activity

  1. added this to the 3.0.0 milestone on May 13, 2026
  2. self-assigned this
    on May 13, 2026
  3. added 3 commits that reference this issue on May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions