File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Provides the Typescript API/SPI for the [Serverless Workflow Specification](http
66With the SDK you can:
77* Parse workflow JSON and YAML definitions
88* (_ WIP_ ) Programmatically build workflow definitions
9-
9+ * ( _ WIP _ ) Validate workflow definitions
1010
1111## Getting Started
1212
@@ -107,5 +107,26 @@ by using the static methods `toJSON` or `toYAML` respectively:
107107 const workflowAsYAML = BaseWorkflow .toYAML (workflow );
108108```
109109
110+ #### Validate workflow definitions
111+
112+ The sdk provides a way to validate if a workflow object is compliant with the serverlessworkflow specification.
113+
114+ ` WorkflowValidator ` class provides two methods:
115+
116+ - ` isValid(): boolean `
117+
118+ ``` typescript
119+
120+ const isValid = new WorkflowValidator (workflow ).isValid ();
121+
122+ ```
123+
124+ - ` validate(): ValidationErrors `
110125
126+ ``` typescript
111127
128+ const validationErrors = new WorkflowValidator (workflow ).validate ();
129+ validationErrors .errors ().forEach (error => console .error (error .message ()))
130+
131+
132+ ```
You can’t perform that action at this time.
0 commit comments