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

Add explicit JSON tags for OptimizelyConfig. #228

Merged
merged 1 commit into from
Jan 15, 2020

Conversation

mikecdavis
Copy link
Contributor

Summary

  • Add JSON tags to OptimizelyConfig

Marshaling of the OptimizelyConfig into JSON was picking up the literal struct field names. This change uses JSON tags to map the struct fields to a more JSON friendlier representation.

Before:

"ExperimentsMap": {
    "sample_test": {
        "ID": "10000",
        "Key": "sample_test",
        "VariationsMap": {
            "sample_variation": {
                "FeatureEnabled": true,
                "ID": "20000",
                "Key": "sample_variation",
                "VariablesMap": {
                    "sample_variable": {
                        "ID": "30000",
                        "Key": "sample_variable",
                        "Type": "string",
                        "Value": "winning"
                    },

After:

"experimentsMap": {
    "sample_test": {
        "id": "10000",
        "key": "sample_test",
        "variationsMap": {
            "sample_variation": {
                "featureEnabled": true,
                "id": "20000",
                "key": "sample_variation",
                "variablesMap": {
                    "sample_variable": {
                        "id": "30000",
                        "key": "sample_variable",
                        "type": "string",
                        "value": "winning"
                    },      

Copy link

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@mikecdavis mikecdavis merged commit b75e05a into master Jan 15, 2020
@mikecdavis mikecdavis deleted the mikecdavis/add-json-annotations branch January 15, 2020 17:25
Copy link
Contributor

@pawels-optimizely pawels-optimizely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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.

4 participants