Skip to content

Commit a660050

Browse files
authored
add json tag to nested objects (#138)
Signed-off-by: Spolti <filippespolti@gmail.com> Signed-off-by: Spolti <filippespolti@gmail.com>
1 parent 70fa525 commit a660050

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

hack/go-lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
golangci-lint run -E goimports -E errorlint -E gosec "${1}" ./... --timeout 2m0s
16+
golangci-lint run -E goimports -E errorlint -E gosec ${1} ./... --timeout 2m0s

model/auth.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ type AuthProperties interface {
117117

118118
// BaseAuthProperties ...
119119
type BaseAuthProperties struct {
120-
Common
120+
Common `json:",inline"`
121121
// Secret Expression referencing a workflow secret that contains all needed auth info
122122
Secret string `json:"secret,omitempty"`
123123
}
@@ -157,7 +157,7 @@ func (b *BasicAuthProperties) DeepCopyAuthProperties() AuthProperties {
157157

158158
// BasicAuthProperties Basic Auth Info
159159
type BasicAuthProperties struct {
160-
BaseAuthProperties
160+
BaseAuthProperties `json:",inline"`
161161
// Username String or a workflow expression. Contains the username
162162
Username string `json:"username" validate:"required"`
163163
// Password String or a workflow expression. Contains the user password
@@ -188,7 +188,7 @@ func (b *BasicAuthProperties) UnmarshalJSON(data []byte) error {
188188

189189
// BearerAuthProperties Bearer auth information
190190
type BearerAuthProperties struct {
191-
BaseAuthProperties
191+
BaseAuthProperties `json:",inline"`
192192
// Token String or a workflow expression. Contains the token
193193
Token string `json:"token" validate:"required"`
194194
}
@@ -218,7 +218,7 @@ func (b *BearerAuthProperties) UnmarshalJSON(data []byte) error {
218218

219219
// OAuth2AuthProperties OAuth2 information
220220
type OAuth2AuthProperties struct {
221-
BaseAuthProperties
221+
BaseAuthProperties `json:",inline"`
222222
// Authority String or a workflow expression. Contains the authority information
223223
Authority string `json:"authority,omitempty" validate:"omitempty,min=1"`
224224
// GrantType Defines the grant type

model/function.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type FunctionType string
4242

4343
// Function ...
4444
type Function struct {
45-
Common
45+
Common `json:",inline"`
4646
// Unique function name
4747
Name string `json:"name" validate:"required"`
4848
// If type is `rest`, <path_to_openapi_definition>#<operation_id>. If type is `rpc`, <path_to_grpc_proto_file>#<service_name>#<service_method>.

model/object.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
// parsed to int32
3434
// - raw - holds any not typed value, replaces the interface{} behavior.
3535
type Object struct {
36-
IObject
36+
IObject `json:",inline"`
3737
}
3838

3939
// IObject interface that can converted into one of the three subtypes

model/states.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
package model
1616

17+
// StateType ...
18+
type StateType string
19+
1720
const (
1821
// StateTypeDelay ...
1922
StateTypeDelay = "delay"
@@ -59,9 +62,6 @@ func getActionsModelMapping(stateType string) (State, bool) {
5962
return nil, false
6063
}
6164

62-
// StateType ...
63-
type StateType string
64-
6565
// State definition for a Workflow state
6666
type State interface {
6767
GetID() string

model/workflow.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,6 @@ type ProduceEvent struct {
592592
// TODO
593593
Data string `json:"data,omitempty"`
594594
// Add additional event extension context attributes
595-
// TODO map[string]interface{}
596595
ContextAttributes map[string]string `json:"contextAttributes,omitempty"`
597596
}
598597

0 commit comments

Comments
 (0)