Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify user message in phx.gen.json #5787

Merged
merged 2 commits into from May 4, 2024

Conversation

ponychicken
Copy link
Contributor

The statement "Add the resource to your :api scope" is confusing for new-comers.

Users will open the router.ex file, and quickly find a section:

  pipeline :api do
    plug :accepts, ["json"]
  end

and paste the line into this block.

Experienced phoenix devs will understand that this is a pipeline and not a scope, but these semantics will not be obvious the newby.

The pull request changes the line to read:
"Add the resource to "/api" scope" or ( "Add the resource to "/api/v1" scope" if you have configured the api_endpoint like this)

I was struggling with this, and this user on the forums as well:
https://elixirforum.com/t/can-someone-please-help-me-with-this-basic-api-creation-rubber-ducky-edition/53684/7

@josevalim
Copy link
Member

Thank you for the PR! Can you please update the failing tests?

@ponychicken
Copy link
Contributor Author

Tests are working locally now

@josevalim josevalim merged commit 12582af into phoenixframework:main May 4, 2024
4 of 6 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants