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

Custom key/context serializers #30

Merged
merged 1 commit into from
Sep 27, 2023
Merged

Custom key/context serializers #30

merged 1 commit into from
Sep 27, 2023

Conversation

rawilk
Copy link
Owner

@rawilk rawilk commented Sep 27, 2023

PR makes it possible to define custom serializers for both setting keys and the context object. This allows for more flexibility on how setting keys are generated.

A new context serializer is also added, called DotNotationContextSerializer. This serializer maps each context argument into {key}:{value} pairs, and then implodes them together using :: as a separator instead of using serialize like the default serializer does. It will also detect a model class if it is keyed as model, and from that it will use the model's morph class intead of full name-spaced class in the key.

Before by default, all generated setting keys were hashed with md5, however that makes searching for multiple setting keys difficult. Now there is a new key generator, called ReadableKeyGenerator, which does not hash the key at all.

@rawilk rawilk merged commit c31a582 into v3.x Sep 27, 2023
8 checks passed
@rawilk rawilk deleted the feature/value-serializers branch September 27, 2023 20:22
@rawilk rawilk added the enhancement New feature or request label Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant