Skip to content

Commit

Permalink
fix(ocpp1.6/core): allow empty idTag
Browse files Browse the repository at this point in the history
  • Loading branch information
hnicolaysen committed Feb 26, 2024
1 parent 7cf6811 commit d06b94f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions ocpp1.6/core/authorize.go
Original file line number Diff line number Diff line change
@@ -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) --------------------
Expand All @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions ocpp1.6/core/start_transaction.go
Original file line number Diff line number Diff line change
@@ -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) --------------------
Expand All @@ -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"`
Expand Down

0 comments on commit d06b94f

Please sign in to comment.