mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-04-23 02:34:48 -05:00
771b733e10
* feat: add parent task external id to api for workflow run * feat: wire up parent ids * feat: custom go type for non-null json * feat: gen * feat: send action ids back over the api * fix: lint
30 lines
537 B
Go
30 lines
537 B
Go
package openapi
|
|
|
|
import (
|
|
"bytes"
|
|
"encoding/json"
|
|
)
|
|
|
|
type NonNullableJSON map[string]interface{}
|
|
|
|
func (m *NonNullableJSON) UnmarshalJSON(data []byte) error {
|
|
if bytes.Equal(data, []byte("null")) {
|
|
*m = NonNullableJSON{}
|
|
return nil
|
|
}
|
|
|
|
var raw map[string]interface{}
|
|
if err := json.Unmarshal(data, &raw); err != nil {
|
|
return err
|
|
}
|
|
*m = NonNullableJSON(raw)
|
|
return nil
|
|
}
|
|
|
|
func (m NonNullableJSON) MarshalJSON() ([]byte, error) {
|
|
if m == nil {
|
|
return []byte("{}"), nil
|
|
}
|
|
return json.Marshal(map[string]interface{}(m))
|
|
}
|