Skip to content

Add schema site contract model #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danischm
Copy link
Contributor

@danischm danischm commented Apr 21, 2023

"contractRef": contractRef,
}

return &SiteContract{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We moved to a generic version of PatchPayload in the latest code so if you can use this going forward.

Suggested change
return &SiteContract{
return & PatchPayload{

Comment on lines +3 to +7
type SiteContract struct {
Ops string `json:",omitempty"`
Path string `json:",omitempty"`
Value map[string]interface{} `json:",omitempty"`
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type SiteContract struct {
Ops string `json:",omitempty"`
Path string `json:",omitempty"`
Value map[string]interface{} `json:",omitempty"`
}

Comment on lines +21 to +30
func (contractAttributes *SiteContract) ToMap() (map[string]interface{}, error) {
contractAttributesMap := make(map[string]interface{})
A(contractAttributesMap, "op", contractAttributes.Ops)
A(contractAttributesMap, "path", contractAttributes.Path)
if contractAttributes.Value != nil {
A(contractAttributesMap, "value", contractAttributes.Value)
}

return contractAttributesMap, nil
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func (contractAttributes *SiteContract) ToMap() (map[string]interface{}, error) {
contractAttributesMap := make(map[string]interface{})
A(contractAttributesMap, "op", contractAttributes.Ops)
A(contractAttributesMap, "path", contractAttributes.Path)
if contractAttributes.Value != nil {
A(contractAttributesMap, "value", contractAttributes.Value)
}
return contractAttributesMap, nil
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants