mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
* feat(EN-420): added page size as a const for each plugin * feat(EN-420): remove pageSize from connector config * feat(EN-420): review all limits according to api docs * ensure pageSize is marked as deprecated * sdk generation * fix: tests * fix: ignore linting error on depreated call * feat: change deprecation message * regenerate openapi & sdk * change message to avoid duplicating the deprecation word * regenerate openapi & sdk * feat: change deprecation message * regenerate openapi & sdk
26 lines
682 B
Go
26 lines
682 B
Go
package dummypay
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
|
|
"github.com/go-playground/validator/v10"
|
|
)
|
|
|
|
type Config struct {
|
|
Directory string `json:"directory" validate:"required,dirpath"`
|
|
CreateLinkFlowError bool `json:"linkFlowError" validate:""`
|
|
UpdateLinkFlowError bool `json:"updateLinkFlowError" validate:""`
|
|
}
|
|
|
|
const PAGE_SIZE = 25
|
|
|
|
func unmarshalAndValidateConfig(payload json.RawMessage) (Config, error) {
|
|
var config Config
|
|
if err := json.Unmarshal(payload, &config); err != nil {
|
|
return Config{}, fmt.Errorf("failed to unmarshal config: %w", err)
|
|
}
|
|
validate := validator.New(validator.WithRequiredStructEnabled())
|
|
return config, validate.Struct(config)
|
|
}
|