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

Separate nested resource name #855

Merged
merged 3 commits into from Apr 10, 2023

Conversation

PanosCodes
Copy link
Contributor

@PanosCodes PanosCodes commented Mar 28, 2023

Why

Closes #455

How

  • Updates get_resource_name to return a - seperated resource id.
    The expected behavior when Apipie.configuration.namespaced_resources? is true is for a nested resource like V1::Users::TweetsController to return v1-users-tweets however it was returning v1userstweets

  • Uses the above dash separated format to return a readable nested resource name. Example if id is some-nested-resource #name will return Some::Nested::Resource that is later used in views.

@PanosCodes PanosCodes changed the title Separate nested resource names Separate nested resource name Mar 28, 2023
@PanosCodes PanosCodes force-pushed the separate-nested-resource-names branch from 91f9f1b to a622122 Compare March 28, 2023 16:12
The expected behavior when `Apipie.configuration.namespaced_resources?` 
is true is for a nested resource like `V1::Users::TweetsController` to
return `v1-users-tweets` however it was returning `v1userstweets`
- Rename the `resource_name` argument to `id`, it can be missleading
- Create `name` method return a human readable resource name depending 
  on the `@id`. Example if id is `some-nested-resource` `#name` will 
  return `Some::Nested::Resource`
@PanosCodes PanosCodes force-pushed the separate-nested-resource-names branch from a622122 to fb0a537 Compare March 28, 2023 16:37
@mathieujobin mathieujobin merged commit 1f28905 into Apipie:master Apr 10, 2023
18 checks passed
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.

Documentation not working when same name of controllers reside in scopes
2 participants