swagger-api / swagger-api/swagger-codegen

routing should be in routes/web.php for generated Lumen server stub

Open
#7,530 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

routing should be in routes/web.php for generated Lumen server stub ever since Lumen 5.3+.
The generated Lumen server stub put all routing in lib\app\Http\routes.php.
This works only for Lumen 5.2 and older version. Please refer to:
https://lumen.laravel.com/docs/5.2/routing#basic-routing

Swagger-codegen version

2.3.1

Swagger declaration file content or url

any API doc in yaml/json format, including default PetStore example.

Command line used for generation

Using codegen functionality integrated in swagger-editor. But I don't think it's related with specific cmd line options a.f.a.i.k.

Steps to reproduce

Select generate server->Lumen in swagger-editor menu.

Related issues/PRs
Suggest a fix/enhancement

Ever since Lumen 5.3+ (my framework: Lumen 5.5), the routing has been moved to routes\web.php.
And with this directory structure changes, current generated server stub code would cause error 404
due to syntactic error in routes.php.
Please refer to:
https://lumen.laravel.com/docs/5.3/routing#basic-routing

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the generated Lumen server stub's lib/app/Http/routes.php and the routes/web.php location described in the issue. Generate a server from the default PetStore YAML, verify the routing placement for Lumen 5.5, and confirm the generated application no longer produces a 404 from the misplaced routes.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.