When I am calling an endpoint point getting below two json.
In response, I need to send one json response.
In Json1 value
is empty and need to get the value from Json2.
I am unable to get attributes with in LayoutSections
Json:1
{
"Name": "VisitDoctorLayout",
"Kind": "Visit",
"layoutsections": [
{
"label": "AccountInformation",
"style": "TwoColumnsTopToBottom",
"layoutcolumns": [
{
"layoutitems": [
{
"behavior": "edit",
"name": "firstname",
"type": "string",
"label": "first Name",
"value": ""
},
{
"behavior": "Required",
"name": "lastname",
"type": "string",
"label": "Last Name",
"value": ""
}
]
}
]
}
]
}
Json:2
{"firstname":"ABC",
"lastname":"EFZ"
}
My sruct is something like below
type Layout struct {
ID string `json:"ID"`
Name string `json:"name"`
Kind string `json:"kind"`
Namespace string `json:"namespace"`
LayoutSections []LayoutSections `json:"layoutsections"`
}
type LayoutSections struct {
Label string `json:"label"`
Style string `json:"style"`
LayoutColumns []LayoutColumns `json:"layoutcolumns"`
}
type LayoutColumns struct {
LayoutItems []LayoutItems `json:"layoutitems"`
}
type LayoutItems struct {
Behavior string `json:"behavior"`
Name string `json:"name"`
Type string `json:"type"`
Label string `json:"label"`
Value string `json:"value"`
}