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

#483 Support DoNoSerialize by pattern #496

Merged

Conversation

mayhammf
Copy link
Contributor

@mayhammf mayhammf commented May 10, 2023

Introduced a new settings key "DoNotSerializePattern" which can be used to exclude properties based on a regex expression.

Reason for not using the existing settings entry is not to mess with the performance of the serialization in any way (unless consumer opts in for use the pattern exclusion).

Example value:

{
    "Settings": {
        "DoNotSerialize": "serverName,supportEmail", 
        "DoNotSerializePattern": "(?i)[a-z]+_(localProp|envProp)" 
    }
}

@mayhammf
Copy link
Contributor Author

mayhammf commented May 10, 2023

@KevinJump
Perhaps something like this for #483
Sadly I'm unable to compile the project so i couldn't test it. I'll try again later unless it looks good to you.

@KevinJump
Copy link
Owner

This looks good, I will run some tests and we will fold it into the next release.

@mayhammf
Copy link
Contributor Author

Good to hear. I believe you'll cherrypick it into v10 as well? 😊

@KevinJump
Copy link
Owner

Yeah we will get this into the v10 release too.

@KevinJump KevinJump merged commit fef714b into KevinJump:v11/dev May 10, 2023
1 check passed
KevinJump pushed a commit that referenced this pull request May 11, 2023
* #483 added regex support to the DoNoSerialize settings.Introduced a new settings key DoNoSerializePatterns to avoid messing with the exsting one.

* Simplify by allowing a single pattern instead as that can be done within the expression.

* Correct key name; now it's a singular.

* cleanup method name

---------

Co-authored-by: Ayham Fakihani <af@frankly.dk>
@KevinJump
Copy link
Owner

in v10.6 and v11.2 (both released now)

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.

None yet

3 participants