feat: generate fields validation and use it when sending requests to API (#7)
* feat: generate fields validation and use it when issuing requests to API with soft (default) or hard modes * chore: apply linter fixes * feat: enable field validation on int fields * feat: add validation for ^[\w]+$ fields * feat: add validation for MAC address fields * fix: trim wrappers for all comments * feat: add validation for IPv4, IPv6 and IP(IPv4/IPv6) fields * feat: add validation for numeric, non-zero based fields * fix: one of validation can contain dot (.) sign in values * feat: add second notation of MAC address validation * fix: one of validation can start with ^( and end with )$ * feat: add option to disable validation and use soft validation by default * chore: fix test * docs: add readme about client-side validation
This commit is contained in:
committed by
GitHub
parent
9f4fe33d07
commit
53bb1a13b9
4
unifi/setting_broadcast.generated.go
generated
4
unifi/setting_broadcast.generated.go
generated
@@ -29,10 +29,10 @@ type SettingBroadcast struct {
|
||||
|
||||
SoundAfterEnabled bool `json:"sound_after_enabled"`
|
||||
SoundAfterResource string `json:"sound_after_resource,omitempty"`
|
||||
SoundAfterType string `json:"sound_after_type,omitempty"` // sample|media
|
||||
SoundAfterType string `json:"sound_after_type,omitempty" validate:"omitempty,oneof=sample media"` // sample|media
|
||||
SoundBeforeEnabled bool `json:"sound_before_enabled"`
|
||||
SoundBeforeResource string `json:"sound_before_resource,omitempty"`
|
||||
SoundBeforeType string `json:"sound_before_type,omitempty"` // sample|media
|
||||
SoundBeforeType string `json:"sound_before_type,omitempty" validate:"omitempty,oneof=sample media"` // sample|media
|
||||
}
|
||||
|
||||
func (dst *SettingBroadcast) UnmarshalJSON(b []byte) error {
|
||||
|
||||
Reference in New Issue
Block a user