active_model_serializers icon indicating copy to clipboard operation
active_model_serializers copied to clipboard

Add allow_wildcard configuration

Open Borzik opened this issue 5 years ago • 0 comments

Purpose

jsonapi-renderer provides an allow_wildcard configuration which can be used to configure how * and ** include directives are treated. Since these wildcards are specific to AMS, in some cases it might be better to completely disable them instead of calling gsub(/\*/, '') on every include parameter passed to the API.

Changes

This PR adds a way to disable these wildcards by updating how JSONAPI::IncludeDirective is initialized. Default behaviour remains the same. When config.allow_wildcard is false, wildcards will be ignored by jsonapi-renderer.

Caveats

default_includes configuration, which is currently *, will not be respected and will be handled as if it was an empty string

Borzik avatar Oct 25 '19 10:10 Borzik