diff --git a/ocpp1.6/core/authorize.go b/ocpp1.6/core/authorize.go index 3a9874ad..ab48cf09 100644 --- a/ocpp1.6/core/authorize.go +++ b/ocpp1.6/core/authorize.go @@ -1,8 +1,9 @@ package core import ( - "github.com/lorenzodonini/ocpp-go/ocpp1.6/types" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp1.6/types" ) // -------------------- Authorize (CP -> CS) -------------------- @@ -11,7 +12,7 @@ const AuthorizeFeatureName = "Authorize" // The field definition of the Authorize request payload sent by the Charge Point to the Central System. type AuthorizeRequest struct { - IdTag string `json:"idTag" validate:"required,max=20"` + IdTag string `json:"idTag" validate:"omitempty,max=20"` } // This field definition of the Authorize confirmation payload, sent by the Charge Point to the Central System in response to an AuthorizeRequest. diff --git a/ocpp1.6/core/start_transaction.go b/ocpp1.6/core/start_transaction.go index 3b3bdaf6..3a0fef3d 100644 --- a/ocpp1.6/core/start_transaction.go +++ b/ocpp1.6/core/start_transaction.go @@ -1,8 +1,9 @@ package core import ( - "github.com/lorenzodonini/ocpp-go/ocpp1.6/types" "reflect" + + "github.com/lorenzodonini/ocpp-go/ocpp1.6/types" ) // -------------------- Start Transaction (CP -> CS) -------------------- @@ -12,7 +13,7 @@ const StartTransactionFeatureName = "StartTransaction" // This field definition of the StartTransactionRequest payload sent by the Charge Point to the Central System. type StartTransactionRequest struct { ConnectorId int `json:"connectorId" validate:"gt=0"` - IdTag string `json:"idTag" validate:"required,max=20"` + IdTag string `json:"idTag" validate:"omitempty,max=20"` MeterStart int `json:"meterStart" validate:"gte=0"` ReservationId *int `json:"reservationId,omitempty" validate:"omitempty"` Timestamp *types.DateTime `json:"timestamp" validate:"required"`