I am getting input to this struct through postman. When the request is received to controller, it binds the params to this struct.
c.Params.BindJSON(&mvm)
I did a validation first without values for vnetname and subnetname and I can catch the errors. The next time I supplied vnet name and I get error for subnetname. When I removed vnet and provided subnetname, I didn't get error for vnet. Also I tried removing both vnet and subnet and I still don't get the validation errors. I can see that the inputs I gave for the last time is still being used instead of the new ones.
Hi,
I am using revel framework and this is my struct
type MVMVARS struct { Location string
json:"location" validate:"empty=false"
VMName stringjson:"vm_name" validate:"empty=false"
ResourceGroupName stringjson:"rg_name" validate:"empty=false"
AdminUsername stringjson:"admin_username" validate:"empty=false"
AdminPassword stringjson:"admin_password" validate:"empty=false"
VMSku stringjson:"vm_sku" validate:"empty=false"
VMSize stringjson:"vm_size" validate:"empty=false"
OSDataDiskSizeInGB intjson:"osdatadisksizeingb"
DataDisks []intjson:"data_disks"
BootDiagStorageAccount stringjson:"boot_diag_storage"
VnetName stringjson:"vnet_name" validate:"empty=false"
SubnetName stringjson:"subnet_name" validate:"empty=false"
AvailabilitySet stringjson:"availability_set"
IdentityID []stringjson:"identity_id"
SubscriptionID stringjson:"subscription_Id" validate:"empty=false"
}I am getting input to this struct through postman. When the request is received to controller, it binds the params to this struct.
c.Params.BindJSON(&mvm)
I did a validation first without values for vnetname and subnetname and I can catch the errors. The next time I supplied vnet name and I get error for subnetname. When I removed vnet and provided subnetname, I didn't get error for vnet. Also I tried removing both vnet and subnet and I still don't get the validation errors. I can see that the inputs I gave for the last time is still being used instead of the new ones.
Could you help us to identify this issue.