Skip to content

Add global defaults.normalization_context.gen_id configuration option#7775

Open
olinox14 wants to merge 1 commit intoapi-platform:mainfrom
olinox14:feature/global-genid-setting
Open

Add global defaults.normalization_context.gen_id configuration option#7775
olinox14 wants to merge 1 commit intoapi-platform:mainfrom
olinox14:feature/global-genid-setting

Conversation

@olinox14
Copy link

@olinox14 olinox14 commented Feb 17, 2026

Q A
Branch? main
Tickets None
License MIT
Doc PR api-platform/docs#2252

Add the possibility to set a new option in api/config/packages/api_platform.yaml (or config/api-platform.php for Laravel) :

api_platform:
    defaults:
        normalization_context:
            gen_id: false

If set to false, this will globally disable the Skolem IRIs generation for all properties.
If not set, the default value for $context['output']['gen_id'] would stay true.
#[ApiProperty(genId: true|false)] will still take precedence.

@soyuka
Copy link
Member

soyuka commented Feb 17, 2026

Hi thanks for the feature! Could you add a test (functional or unit your choice)?

I wonder if it would be nice to have actual property defaults.

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.

2 participants