fix: wrong return from get and list for migration #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After a change in the API, GetMigration and ListMigration were improperly returning values that only supported outbound migrations.
The tricky bit here was that MigrationState could hold either an Inbound or an Outbound in the Migration field.
To deal with this I used a json.RawMessage to hold the field's contents temporarily. Alternative approaches resulted in a field full of horrifying nested maps no developer was ever meant to see.
Once we have the RawMessage we can properly unmarshal it and return things. The end user should have an easier time as they can call GetMigrationType() and then type assert to the correct value.