PHPackages                             netgen/api-platform-extras - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. netgen/api-platform-extras

ActiveSymfony-bundle[API Development](/categories/api)

netgen/api-platform-extras
==========================

Adaptations to default api platform stack mechanisms

098PHPCI passing

Since Jun 5Pushed 4w ago1 watchersCompare

[ Source](https://github.com/netgen/api-platform-extras)[ Packagist](https://packagist.org/packages/netgen/api-platform-extras)[ RSS](/packages/netgen-api-platform-extras/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (8)Used By (0)

api-platform-extras
===================

[](#api-platform-extras)

Configuration (config/packages/api\_platform\_extras.yaml):

```
api_platform_extras:
  features:
    # NOT IMPLEMENTED YET
    http_cache:
      enabled: false
    schema_decoration:
      enabled: false
      #Mark schema properties as required by default when the type is not nullable.
      default_required_properties: false
      #Additionally mark nullable types as required - safe to use if api_platform.defaults.normalization_context.skip_null_values set to false (default true).
      nullable_required: false
      #Add @id as an optional property to all POST, PUT and PATCH schemas.
      jsonld_update_schema: false
    hydra_pagination_enrichment:
      #Adds numeric pagination fields to Hydra view keys (prefix depends on api_platform.serializer.hydra_prefix).
      enabled: false
    # NOT IMPLEMENTED YET
    simple_normalizer:
      enabled: false
    jwt_refresh:
      enabled: false
      auto_refresh_cookie: false
      auto_refresh_header: false
      user_aware: false
      ignored_routes: []
      ignored_paths: []
      allowed_firewalls: []
    iri_template_generator:
      enabled: false
    schema_processor:
      enabled: false
```

Enable features by setting the corresponding flag to true.

Hydra Pagination Enrichment Feature
-----------------------------------

[](#hydra-pagination-enrichment-feature)

`hydra_pagination_enrichment` adds numeric pagination fields (`firstPage`, `lastPage`, `currentPage`, `previousPage`, `nextPage`, `itemsPerPage`) to Hydra collection view in both schema and response.

- ! enrichment skipped if cursor pagination used

The Hydra key prefix is controlled by API Platform and is boolean:

- `api_platform.serializer.hydra_prefix: true` -&gt; prefixed keys (for example `hydra:view`, `hydra:first`)
- `api_platform.serializer.hydra_prefix: false` (default) -&gt; unprefixed keys (`view`, `first`)

JWT Refresh Feature
-------------------

[](#jwt-refresh-feature)

`jwt_refresh` is active only when:

- `api_platform_extras.features.jwt_refresh.enabled: true`
- at least one of:
    - `api_platform_extras.features.jwt_refresh.auto_refresh_cookie: true`
    - `api_platform_extras.features.jwt_refresh.auto_refresh_header: true`

If both auto-refresh flags are `false`, behavior is effectively the same as feature disabled.

`user_aware` defaults to `false`. When enabled, refresh token handling validates that the selected user provider supports the user class stored on the refresh token.

### Related bundle config

[](#related-bundle-config)

JWT/refresh token names and header prefix are taken from Lexik/Gesdinet config (with bundle defaults):

- `lexik_jwt_authentication.token_extractors.authorization_header.prefix` (default: `Bearer`)
- `lexik_jwt_authentication.token_extractors.authorization_header.name` (default: `Authorization`)
- `lexik_jwt_authentication.token_extractors.cookie.name` (default: `BEARER`)
- `gesdinet_jwt_refresh_token.token_parameter_name` (default: `refresh_token`)

When Lexik extractor parameters are not exposed as container parameters, values are read from Lexik extractor service definition arguments.

### Refresh token entity

[](#refresh-token-entity)

When using custom refresh token entities, extend the bundle entity:

```
