Skip to content

Fixed doc about "path_segment_name_generator" for v2.1+ #367

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

Merged
merged 1 commit into from
Dec 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions core/operation-path-naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ Pre-registered resolvers are available and can easily be overridden.

There are two pre-registered operation path naming services:

Service name | Entity name | Path result
--------------------------------------------------|--------------|----------------
`api_platform.operation_path_resolver.underscore` | `MyResource` | `/my_resources`
`api_platform.operation_path_resolver.dash` | `MyResource` | `/my-resources`
Service name | Entity name | Path result
------------------------------------------------------|--------------|----------------
`api_platform.path_segment_name_generator.underscore` | `MyResource` | `/my_resources`
`api_platform.path_segment_name_generator.dash` | `MyResource` | `/my-resources`

The default resolver is `api_platform.operation_path_resolver.underscore`.
The default resolver is `api_platform.path_segment_name_generator.underscore`.
To change it to the dash resolver, add the following lines to `app/config/config.yml`:

```yaml
# app/config/config.yml

api_platform:
default_operation_path_resolver: 'api_platform.operation_path_resolver.dash'
path_segment_name_generator: api_platform.path_segment_name_generator.dash
```

## Create a Custom Operation Path Resolver
Expand Down Expand Up @@ -75,5 +75,5 @@ services:
# app/config/config.yml

api_platform:
default_operation_path_resolver: 'AppBundle\PathResolver\NoSeparatorsOperationPathResolver'
path_segment_name_generator: 'AppBundle\PathResolver\NoSeparatorsOperationPathResolver'
```