Repository: ChristopheBougere/asl-validator (ts)

Issue:
null is no longer a valid ResultPath
**Describe the bug**
`"ResultPath": null` [is used for discarding the output of a state](https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultpath.html#input-output-resultpath-null). Since upgrading to 3.0.2, schema validation is now failing with:
``` javascript
[
  {
    'Error code': 'SCHEMA_VALIDATION_FAILED',
    Message: '/States/Hello/ResultPath is invalid. must be string',
    schemaError: {
      instancePath: '/States/Hello/ResultPath',
      schemaPath: 'paths.json#/definitions/asl_ref_path/type'
    }
  }
]
```

**To Reproduce**
```json
{
    "StartAt": "Hello",
    "States": {
        "Hello": {
            "Type": "Task",
            "Resource": "arn:aws:lambda:us-east-1:123456789012:function:foo",
            "Parameters": {
                "foo.$": "$.foo"
            },
            "ResultPath": null,
            "Next": "Goodbye"
        },
        "Goodbye": {
            "Type": "Succeed"
        }
    }
}
```

**Expected behavior**

`null` is accepted as a valid ResultPath.

**Version:**
3.0.2


Pull request:
fix: null is a valid resultpath
Closes #106. Treats a ResultPath of `null` as valid schema. New to the refactored version here so please offer corrections where needed.

Patch:
diff --git a/src/schemas/paths.json b/src/schemas/paths.json
index cb5d0d2..5efcae4 100644
--- a/src/schemas/paths.json
+++ b/src/schemas/paths.json
@@ -3,11 +3,11 @@
   "$schema": "http://json-schema.org/draft-07/schema#",
   "definitions": {
     "asl_path": {
-      "type": "string",
+      "type": ["string", "null"],
       "format": "asl_path"
     },
     "asl_ref_path": {
-      "type": "string",
+      "type": ["string", "null"],
       "format": "asl_ref_path"
     },
     "_payload_template_object": {


Test patch:
diff --git a/src/__tests__/definitions/valid-null-input.json b/src/__tests__/definitions/valid-null-input.json
new file mode 100644
index 0000000..d6dd7c2
--- /dev/null
+++ b/src/__tests__/definitions/valid-null-input.json
@@ -0,0 +1,15 @@
+{
+    "StartAt": "Hello",
+    "States": {
+        "Hello": {
+            "Type": "Task",
+            "Resource": "arn:aws:lambda:us-east-1:123456789012:function:foo",
+            "InputPath": null,
+            "ResultPath": "$.foo",
+            "Next": "Goodbye"
+        },
+        "Goodbye": {
+            "Type": "Succeed"
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/__tests__/definitions/valid-null-result.json b/src/__tests__/definitions/valid-null-result.json
new file mode 100644
index 0000000..aa3a535
--- /dev/null
+++ b/src/__tests__/definitions/valid-null-result.json
@@ -0,0 +1,17 @@
+{
+    "StartAt": "Hello",
+    "States": {
+        "Hello": {
+            "Type": "Task",
+            "Resource": "arn:aws:lambda:us-east-1:123456789012:function:foo",
+            "Parameters": {
+                "foo.$": "$.foo"
+            },
+            "ResultPath": null,
+            "Next": "Goodbye"
+        },
+        "Goodbye": {
+            "Type": "Succeed"
+        }
+    }
+}
\ No newline at end of file