this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

agnostic: default putRecord to not include swapRecord field (#935)

The root issue here is "nullable and optional" not being easy to express
with default golang struct marshaling. The result is this swap field
getting set, but as null, which prevents actual updates (only allows
creation).

This PR swaps to omitting the field. Makes it impossible to do a forced
swap check of nil... but can just use create for that?

authored by

bnewbold and committed by
GitHub
5dc531ba f1264043

+1 -1
+1 -1
api/agnostic/repoputRecord.go
··· 23 23 // swapCommit: Compare and swap with the previous commit by CID. 24 24 SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"` 25 25 // swapRecord: Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation 26 - SwapRecord *string `json:"swapRecord" cborgen:"swapRecord"` 26 + SwapRecord *string `json:"swapRecord,omitempty" cborgen:"swapRecord,omitempty"` 27 27 // validate: Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. 28 28 Validate *bool `json:"validate,omitempty" cborgen:"validate,omitempty"` 29 29 }