-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Labels
enhancement 🙏New feature or requestNew feature or request
Description
What would you like to be added:
Custom Structs, to be validated, needs to be registered in the validator in order to get executed.
Example:
type CallbackState struct {
// Defines the action to be executed
Action Action `json:"action" validate:"required"`
To get this validated, there is a need to register the custom struct here:
https://github.com/serverlessworkflow/sdk-go/blob/main/validator/validator.go#L28
Something similar to https://raw.githubusercontent.com/go-playground/validator/master/_examples/custom/main.go
But, the way that the packges are structured, it will lead to a cyclic import error:
package github.com/serverlessworkflow/sdk-go/v2/model
imports github.com/serverlessworkflow/sdk-go/v2/validator
imports github.com/serverlessworkflow/sdk-go/v2/model: import cycle not allowed
Why is this needed:
Allow custom structs to be validated.
Metadata
Metadata
Assignees
Labels
enhancement 🙏New feature or requestNew feature or request