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

Figure out how to handle "{}" #34

Closed
docktermj opened this issue Mar 29, 2024 · 2 comments
Closed

Figure out how to handle "{}" #34

docktermj opened this issue Mar 29, 2024 · 2 comments
Assignees

Comments

@docktermj
Copy link
Contributor

When running a testcase like:

func TestSzConfigAddDataSourceResponseTest000(test *testing.T) {
    ctx := context.TODO()
    jsonString := `"{}"`
    jsonStruct := SzConfigAddDataSourceResponse{}
    err := json.Unmarshal([]byte(jsonString), &jsonStruct)
    testError(test, ctx, err)
    _, err = json.Marshal(jsonStruct)
    testError(test, ctx, err)
}

The following error is returned.

json: cannot unmarshal string into Go value of type typedef.AddDataSource

Figure out how to support unmarshalling "{}".

@docktermj docktermj self-assigned this Mar 29, 2024
@github-actions github-actions bot added the triage Need to triage label Mar 29, 2024
@docktermj docktermj added V4 To be delivered in V4 and removed triage Need to triage labels Mar 29, 2024
@docktermj docktermj removed the V4 To be delivered in V4 label Aug 30, 2024
@docktermj
Copy link
Contributor Author

Answer: Change the value in response-testcases.json to:

    "SzConfigAddDataSourceResponse": {
        "tests": {
            "test-000": {},
            "test-001": {
                "DSRC_ID": 1
            }
        }
    },

@docktermj
Copy link
Contributor Author

Fixed via #43

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

No branches or pull requests

1 participant