Skip to content

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.

5 participants