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

feat: add support for unmarshalling two-dimensional slices of model instances #103

Merged
merged 2 commits into from
Mar 30, 2021

Conversation

padamstx
Copy link
Member

This commit improves the model unmarshalling capabilities within the Go core
by adding support for an additional pattern ([][]MyModel) within the
UnmarshalModel() function. The full set of patterns now supported are:

  • MyModel (model instance)
  • map[string]MyModel (map containing model instances)
  • map[string][]MyModel (map contains slices of model instances
  • []MyModel (slice of model instances)
  • new: [][]MyModel (slice of model instance slices)

@padamstx padamstx self-assigned this Mar 28, 2021
@padamstx
Copy link
Member Author

@mkistler @pyrooka I still need to perform some testing with the Go generator and with the platform-services SDK project, but I think this PR is in shape to begin reviewing.

@@ -50,13 +50,15 @@ func TestUnmarshalPrimitiveString(t *testing.T) {
"bad_type": true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be a variation in this test for [][]string? That is supposed to work, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, adding tests for [][] of primitive types now

@padamstx
Copy link
Member Author

@mkistler I've pushed a new commit that adds tests for two-dimensional arrays of primitive types.

Copy link
Contributor

@mkistler mkistler left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

…nstances

This commit improves the model unmarshalling capabilities within the Go core
by adding support for an additional pattern ([][]MyModel) within the
UnmarshalModel() function.  The full set of patterns now supported are:
- MyModel (model instance)
- map[string]MyModel (map containing model instances)
- map[string][]MyModel (map contains slices of model instances
- []MyModel (slice of model instances)
- new: [][]MyModel (slice of model instance slices)
@padamstx padamstx merged commit 1438a2c into main Mar 30, 2021
@padamstx padamstx deleted the two-dim-arrays branch March 30, 2021 23:07
ibm-devx-automation pushed a commit that referenced this pull request Mar 30, 2021
# [5.3.0](v5.2.1...v5.3.0) (2021-03-30)

### Features

* add support for unmarshalling two-dimensional slices of model instances ([#103](#103)) ([1438a2c](1438a2c))
@ibm-devx-automation
Copy link

🎉 This PR is included in version 5.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants