fix: remove ConversionState from MarshalJson in git_persistence_settings #392
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.
The
ConversionStateis a read-only property that isn't required to be sent to the Octopus server. Creating a new instance of this type usingNewGitPersistenceSettingswill default both of the properties inConversionStateto false, which may not align with the value that is in Octopus. Since we marshal all the properties out to the JSON payload sent to the server, this triggers a server error due to the mismatching conversion state properties which Octopus treats as attempting to be modified.This PR removes these fields from
MarshalJSONas these fields aren't required to be sent to Octopus, nor does it make much sense to be sending back read-only fields in the payload.This won't be a breaking change for 99.9% of use cases:
UnmarshalJSONis unchanged.json.Marshalexternally, this would be a breaking change as the properties will no longer show up. ❓ Is this a concern? I don't expect anyone to be doing this.Relates to OctopusDeploy/terraform-provider-octopusdeploy#24