Skip to content

Invalid namespace for JSON Resources when controller has namespace #329

@spaceemotion

Description

@spaceemotion
  • Laravel Version: 7.21.0
  • PHP Version: 7.4.3
  • Blueprint Version: dev-master (1.16.0)
  • Platform: Linux (Ubuntu 20)

Issue:

When the controller has a custom namespace (e.g. Api), the imports for JSON resources is wrong. They get the same namespace added, while their actual location is just under "Resources":

/**
 * @return \App\Http\Resources\Api\UserCollection
 */

folder structure:

- Http
  - Controllers
    - Api
      - UserController
  - Resources
    - UserCollection

draft.yaml:

models:
  User:
    id: integer
controllers:
  Api/User:
    resource: api

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions