We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
E2532 parameters in step function map
*cfn-lint version: (`cfn-lint --version`)* 0.24.4

*Description of issue.*

Using `parameters` in a `map` state gives this error:

`E2532: Check State Machine Definition for proper syntax`

This is an allowed property for map states: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-map-state.html?shortFooter=true#map-state-example-params

Credit to @tomaschmelik for the find


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/cfnlint/rules/resources/stepfunctions/StateMachine.py`
Content:
```
1 """
2   Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 
4   Permission is hereby granted, free of charge, to any person obtaining a copy of this
5   software and associated documentation files (the "Software"), to deal in the Software
6   without restriction, including without limitation the rights to use, copy, modify,
7   merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
8   permit persons to whom the Software is furnished to do so.
9 
10   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
11   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
12   PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
13   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
14   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
15   SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 """
17 import json
18 import six
19 from cfnlint.rules import CloudFormationLintRule
20 from cfnlint.rules import RuleMatch
21 
22 
23 class StateMachine(CloudFormationLintRule):
24     """Check State Machine Definition"""
25     id = 'E2532'
26     shortdesc = 'Check State Machine Definition for proper syntax'
27     description = 'Check the State Machine String Definition to make sure its JSON. ' \
28                   'Validate basic syntax of the file to determine validity.'
29     source_url = 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html'
30     tags = ['resources', 'stepfunctions']
31 
32     def __init__(self):
33         """Init"""
34         super(StateMachine, self).__init__()
35         self.resource_property_types.append('AWS::StepFunctions::StateMachine')
36 
37     def _check_state_json(self, def_json, state_name, path):
38         """Check State JSON Definition"""
39         matches = []
40 
41         # https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-common-fields.html
42         common_state_keys = [
43             'Next',
44             'End',
45             'Type',
46             'Comment',
47             'InputPath',
48             'OutputPath',
49         ]
50         common_state_required_keys = [
51             'Type',
52         ]
53         state_key_types = {
54             'Pass': ['Result', 'ResultPath', 'Parameters'],
55             'Task': ['Resource', 'ResultPath', 'Retry', 'Catch',
56                      'TimeoutSeconds', 'Parameters', 'HeartbeatSeconds'],
57             'Map': ['MaxConcurrency', 'Iterator', 'ItemsPath', 'ResultPath',
58                     'Retry', 'Catch'],
59             'Choice': ['Choices', 'Default'],
60             'Wait': ['Seconds', 'Timestamp', 'SecondsPath', 'TimestampPath'],
61             'Succeed': [],
62             'Fail': ['Cause', 'Error'],
63             'Parallel': ['Branches', 'ResultPath', 'Retry', 'Catch']
64         }
65         state_required_types = {
66             'Pass': [],
67             'Task': ['Resource'],
68             'Choice': ['Choices'],
69             'Wait': [],
70             'Succeed': [],
71             'Fail': [],
72             'Parallel': ['Branches']
73         }
74 
75         for req_key in common_state_required_keys:
76             if req_key not in def_json:
77                 message = 'State Machine Definition required key (%s) for State (%s) is missing' % (
78                     req_key, state_name)
79                 matches.append(RuleMatch(path, message))
80                 return matches
81 
82         state_type = def_json.get('Type')
83 
84         if state_type in state_key_types:
85             for state_key, _ in def_json.items():
86                 if state_key not in common_state_keys + state_key_types.get(state_type, []):
87                     message = 'State Machine Definition key (%s) for State (%s) of Type (%s) is not valid' % (
88                         state_key, state_name, state_type)
89                     matches.append(RuleMatch(path, message))
90             for req_key in common_state_required_keys + state_required_types.get(state_type, []):
91                 if req_key not in def_json:
92                     message = 'State Machine Definition required key (%s) for State (%s) of Type (%s) is missing' % (
93                         req_key, state_name, state_type)
94                     matches.append(RuleMatch(path, message))
95                     return matches
96         else:
97             message = 'State Machine Definition Type (%s) is not valid' % (state_type)
98             matches.append(RuleMatch(path, message))
99 
100         return matches
101 
102     def _check_definition_json(self, def_json, path):
103         """Check JSON Definition"""
104         matches = []
105 
106         top_level_keys = [
107             'Comment',
108             'StartAt',
109             'TimeoutSeconds',
110             'Version',
111             'States'
112         ]
113         top_level_required_keys = [
114             'StartAt',
115             'States'
116         ]
117         for top_key, _ in def_json.items():
118             if top_key not in top_level_keys:
119                 message = 'State Machine Definition key (%s) is not valid' % top_key
120                 matches.append(RuleMatch(path, message))
121 
122         for req_key in top_level_required_keys:
123             if req_key not in def_json:
124                 message = 'State Machine Definition required key (%s) is missing' % req_key
125                 matches.append(RuleMatch(path, message))
126 
127         for state_name, state_value in def_json.get('States', {}).items():
128             matches.extend(self._check_state_json(state_value, state_name, path))
129         return matches
130 
131     def check_value(self, value, path, fail_on_loads=True):
132         """Check Definition Value"""
133         matches = []
134         try:
135             def_json = json.loads(value)
136         # pylint: disable=W0703
137         except Exception as err:
138             if fail_on_loads:
139                 message = 'State Machine Definition needs to be formatted as JSON. Error %s' % err
140                 matches.append(RuleMatch(path, message))
141                 return matches
142 
143             self.logger.debug('State Machine definition could not be parsed. Skipping')
144             return matches
145 
146         matches.extend(self._check_definition_json(def_json, path))
147         return matches
148 
149     def check_sub(self, value, path):
150         """Check Sub Object"""
151         matches = []
152         if isinstance(value, list):
153             matches.extend(self.check_value(value[0], path, False))
154         elif isinstance(value, six.string_types):
155             matches.extend(self.check_value(value, path, False))
156 
157         return matches
158 
159     def match_resource_properties(self, properties, _, path, cfn):
160         """Check CloudFormation Properties"""
161         matches = []
162 
163         matches.extend(
164             cfn.check_value(
165                 obj=properties, key='DefinitionString',
166                 path=path[:],
167                 check_value=self.check_value,
168                 check_sub=self.check_sub
169             ))
170 
171         return matches
172
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/cfnlint/rules/resources/stepfunctions/StateMachine.py b/src/cfnlint/rules/resources/stepfunctions/StateMachine.py
--- a/src/cfnlint/rules/resources/stepfunctions/StateMachine.py
+++ b/src/cfnlint/rules/resources/stepfunctions/StateMachine.py
@@ -55,7 +55,7 @@
             'Task': ['Resource', 'ResultPath', 'Retry', 'Catch',
                      'TimeoutSeconds', 'Parameters', 'HeartbeatSeconds'],
             'Map': ['MaxConcurrency', 'Iterator', 'ItemsPath', 'ResultPath',
-                    'Retry', 'Catch'],
+                    'Retry', 'Catch', 'Parameters'],
             'Choice': ['Choices', 'Default'],
             'Wait': ['Seconds', 'Timestamp', 'SecondsPath', 'TimestampPath'],
             'Succeed': [],

{"golden_diff": "diff --git a/src/cfnlint/rules/resources/stepfunctions/StateMachine.py b/src/cfnlint/rules/resources/stepfunctions/StateMachine.py\n--- a/src/cfnlint/rules/resources/stepfunctions/StateMachine.py\n+++ b/src/cfnlint/rules/resources/stepfunctions/StateMachine.py\n@@ -55,7 +55,7 @@\n             'Task': ['Resource', 'ResultPath', 'Retry', 'Catch',\n                      'TimeoutSeconds', 'Parameters', 'HeartbeatSeconds'],\n             'Map': ['MaxConcurrency', 'Iterator', 'ItemsPath', 'ResultPath',\n-                    'Retry', 'Catch'],\n+                    'Retry', 'Catch', 'Parameters'],\n             'Choice': ['Choices', 'Default'],\n             'Wait': ['Seconds', 'Timestamp', 'SecondsPath', 'TimestampPath'],\n             'Succeed': [],\n", "issue": "E2532 parameters in step function map\n*cfn-lint version: (`cfn-lint --version`)* 0.24.4\r\n\r\n*Description of issue.*\r\n\r\nUsing `parameters` in a `map` state gives this error:\r\n\r\n`E2532: Check State Machine Definition for proper syntax`\r\n\r\nThis is an allowed property for map states: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-map-state.html?shortFooter=true#map-state-example-params\r\n\r\nCredit to @tomaschmelik for the find\r\n\n", "before_files": [{"content": "\"\"\"\n  Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy of this\n  software and associated documentation files (the \"Software\"), to deal in the Software\n  without restriction, including without limitation the rights to use, copy, modify,\n  merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n  permit persons to whom the Software is furnished to do so.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\"\"\"\nimport json\nimport six\nfrom cfnlint.rules import CloudFormationLintRule\nfrom cfnlint.rules import RuleMatch\n\n\nclass StateMachine(CloudFormationLintRule):\n    \"\"\"Check State Machine Definition\"\"\"\n    id = 'E2532'\n    shortdesc = 'Check State Machine Definition for proper syntax'\n    description = 'Check the State Machine String Definition to make sure its JSON. ' \\\n                  'Validate basic syntax of the file to determine validity.'\n    source_url = 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html'\n    tags = ['resources', 'stepfunctions']\n\n    def __init__(self):\n        \"\"\"Init\"\"\"\n        super(StateMachine, self).__init__()\n        self.resource_property_types.append('AWS::StepFunctions::StateMachine')\n\n    def _check_state_json(self, def_json, state_name, path):\n        \"\"\"Check State JSON Definition\"\"\"\n        matches = []\n\n        # https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-common-fields.html\n        common_state_keys = [\n            'Next',\n            'End',\n            'Type',\n            'Comment',\n            'InputPath',\n            'OutputPath',\n        ]\n        common_state_required_keys = [\n            'Type',\n        ]\n        state_key_types = {\n            'Pass': ['Result', 'ResultPath', 'Parameters'],\n            'Task': ['Resource', 'ResultPath', 'Retry', 'Catch',\n                     'TimeoutSeconds', 'Parameters', 'HeartbeatSeconds'],\n            'Map': ['MaxConcurrency', 'Iterator', 'ItemsPath', 'ResultPath',\n                    'Retry', 'Catch'],\n            'Choice': ['Choices', 'Default'],\n            'Wait': ['Seconds', 'Timestamp', 'SecondsPath', 'TimestampPath'],\n            'Succeed': [],\n            'Fail': ['Cause', 'Error'],\n            'Parallel': ['Branches', 'ResultPath', 'Retry', 'Catch']\n        }\n        state_required_types = {\n            'Pass': [],\n            'Task': ['Resource'],\n            'Choice': ['Choices'],\n            'Wait': [],\n            'Succeed': [],\n            'Fail': [],\n            'Parallel': ['Branches']\n        }\n\n        for req_key in common_state_required_keys:\n            if req_key not in def_json:\n                message = 'State Machine Definition required key (%s) for State (%s) is missing' % (\n                    req_key, state_name)\n                matches.append(RuleMatch(path, message))\n                return matches\n\n        state_type = def_json.get('Type')\n\n        if state_type in state_key_types:\n            for state_key, _ in def_json.items():\n                if state_key not in common_state_keys + state_key_types.get(state_type, []):\n                    message = 'State Machine Definition key (%s) for State (%s) of Type (%s) is not valid' % (\n                        state_key, state_name, state_type)\n                    matches.append(RuleMatch(path, message))\n            for req_key in common_state_required_keys + state_required_types.get(state_type, []):\n                if req_key not in def_json:\n                    message = 'State Machine Definition required key (%s) for State (%s) of Type (%s) is missing' % (\n                        req_key, state_name, state_type)\n                    matches.append(RuleMatch(path, message))\n                    return matches\n        else:\n            message = 'State Machine Definition Type (%s) is not valid' % (state_type)\n            matches.append(RuleMatch(path, message))\n\n        return matches\n\n    def _check_definition_json(self, def_json, path):\n        \"\"\"Check JSON Definition\"\"\"\n        matches = []\n\n        top_level_keys = [\n            'Comment',\n            'StartAt',\n            'TimeoutSeconds',\n            'Version',\n            'States'\n        ]\n        top_level_required_keys = [\n            'StartAt',\n            'States'\n        ]\n        for top_key, _ in def_json.items():\n            if top_key not in top_level_keys:\n                message = 'State Machine Definition key (%s) is not valid' % top_key\n                matches.append(RuleMatch(path, message))\n\n        for req_key in top_level_required_keys:\n            if req_key not in def_json:\n                message = 'State Machine Definition required key (%s) is missing' % req_key\n                matches.append(RuleMatch(path, message))\n\n        for state_name, state_value in def_json.get('States', {}).items():\n            matches.extend(self._check_state_json(state_value, state_name, path))\n        return matches\n\n    def check_value(self, value, path, fail_on_loads=True):\n        \"\"\"Check Definition Value\"\"\"\n        matches = []\n        try:\n            def_json = json.loads(value)\n        # pylint: disable=W0703\n        except Exception as err:\n            if fail_on_loads:\n                message = 'State Machine Definition needs to be formatted as JSON. Error %s' % err\n                matches.append(RuleMatch(path, message))\n                return matches\n\n            self.logger.debug('State Machine definition could not be parsed. Skipping')\n            return matches\n\n        matches.extend(self._check_definition_json(def_json, path))\n        return matches\n\n    def check_sub(self, value, path):\n        \"\"\"Check Sub Object\"\"\"\n        matches = []\n        if isinstance(value, list):\n            matches.extend(self.check_value(value[0], path, False))\n        elif isinstance(value, six.string_types):\n            matches.extend(self.check_value(value, path, False))\n\n        return matches\n\n    def match_resource_properties(self, properties, _, path, cfn):\n        \"\"\"Check CloudFormation Properties\"\"\"\n        matches = []\n\n        matches.extend(\n            cfn.check_value(\n                obj=properties, key='DefinitionString',\n                path=path[:],\n                check_value=self.check_value,\n                check_sub=self.check_sub\n            ))\n\n        return matches\n", "path": "src/cfnlint/rules/resources/stepfunctions/StateMachine.py"}], "after_files": [{"content": "\"\"\"\n  Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy of this\n  software and associated documentation files (the \"Software\"), to deal in the Software\n  without restriction, including without limitation the rights to use, copy, modify,\n  merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n  permit persons to whom the Software is furnished to do so.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\"\"\"\nimport json\nimport six\nfrom cfnlint.rules import CloudFormationLintRule\nfrom cfnlint.rules import RuleMatch\n\n\nclass StateMachine(CloudFormationLintRule):\n    \"\"\"Check State Machine Definition\"\"\"\n    id = 'E2532'\n    shortdesc = 'Check State Machine Definition for proper syntax'\n    description = 'Check the State Machine String Definition to make sure its JSON. ' \\\n                  'Validate basic syntax of the file to determine validity.'\n    source_url = 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html'\n    tags = ['resources', 'stepfunctions']\n\n    def __init__(self):\n        \"\"\"Init\"\"\"\n        super(StateMachine, self).__init__()\n        self.resource_property_types.append('AWS::StepFunctions::StateMachine')\n\n    def _check_state_json(self, def_json, state_name, path):\n        \"\"\"Check State JSON Definition\"\"\"\n        matches = []\n\n        # https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-common-fields.html\n        common_state_keys = [\n            'Next',\n            'End',\n            'Type',\n            'Comment',\n            'InputPath',\n            'OutputPath',\n        ]\n        common_state_required_keys = [\n            'Type',\n        ]\n        state_key_types = {\n            'Pass': ['Result', 'ResultPath', 'Parameters'],\n            'Task': ['Resource', 'ResultPath', 'Retry', 'Catch',\n                     'TimeoutSeconds', 'Parameters', 'HeartbeatSeconds'],\n            'Map': ['MaxConcurrency', 'Iterator', 'ItemsPath', 'ResultPath',\n                    'Retry', 'Catch', 'Parameters'],\n            'Choice': ['Choices', 'Default'],\n            'Wait': ['Seconds', 'Timestamp', 'SecondsPath', 'TimestampPath'],\n            'Succeed': [],\n            'Fail': ['Cause', 'Error'],\n            'Parallel': ['Branches', 'ResultPath', 'Retry', 'Catch']\n        }\n        state_required_types = {\n            'Pass': [],\n            'Task': ['Resource'],\n            'Choice': ['Choices'],\n            'Wait': [],\n            'Succeed': [],\n            'Fail': [],\n            'Parallel': ['Branches']\n        }\n\n        for req_key in common_state_required_keys:\n            if req_key not in def_json:\n                message = 'State Machine Definition required key (%s) for State (%s) is missing' % (\n                    req_key, state_name)\n                matches.append(RuleMatch(path, message))\n                return matches\n\n        state_type = def_json.get('Type')\n\n        if state_type in state_key_types:\n            for state_key, _ in def_json.items():\n                if state_key not in common_state_keys + state_key_types.get(state_type, []):\n                    message = 'State Machine Definition key (%s) for State (%s) of Type (%s) is not valid' % (\n                        state_key, state_name, state_type)\n                    matches.append(RuleMatch(path, message))\n            for req_key in common_state_required_keys + state_required_types.get(state_type, []):\n                if req_key not in def_json:\n                    message = 'State Machine Definition required key (%s) for State (%s) of Type (%s) is missing' % (\n                        req_key, state_name, state_type)\n                    matches.append(RuleMatch(path, message))\n                    return matches\n        else:\n            message = 'State Machine Definition Type (%s) is not valid' % (state_type)\n            matches.append(RuleMatch(path, message))\n\n        return matches\n\n    def _check_definition_json(self, def_json, path):\n        \"\"\"Check JSON Definition\"\"\"\n        matches = []\n\n        top_level_keys = [\n            'Comment',\n            'StartAt',\n            'TimeoutSeconds',\n            'Version',\n            'States'\n        ]\n        top_level_required_keys = [\n            'StartAt',\n            'States'\n        ]\n        for top_key, _ in def_json.items():\n            if top_key not in top_level_keys:\n                message = 'State Machine Definition key (%s) is not valid' % top_key\n                matches.append(RuleMatch(path, message))\n\n        for req_key in top_level_required_keys:\n            if req_key not in def_json:\n                message = 'State Machine Definition required key (%s) is missing' % req_key\n                matches.append(RuleMatch(path, message))\n\n        for state_name, state_value in def_json.get('States', {}).items():\n            matches.extend(self._check_state_json(state_value, state_name, path))\n        return matches\n\n    def check_value(self, value, path, fail_on_loads=True):\n        \"\"\"Check Definition Value\"\"\"\n        matches = []\n        try:\n            def_json = json.loads(value)\n        # pylint: disable=W0703\n        except Exception as err:\n            if fail_on_loads:\n                message = 'State Machine Definition needs to be formatted as JSON. Error %s' % err\n                matches.append(RuleMatch(path, message))\n                return matches\n\n            self.logger.debug('State Machine definition could not be parsed. Skipping')\n            return matches\n\n        matches.extend(self._check_definition_json(def_json, path))\n        return matches\n\n    def check_sub(self, value, path):\n        \"\"\"Check Sub Object\"\"\"\n        matches = []\n        if isinstance(value, list):\n            matches.extend(self.check_value(value[0], path, False))\n        elif isinstance(value, six.string_types):\n            matches.extend(self.check_value(value, path, False))\n\n        return matches\n\n    def match_resource_properties(self, properties, _, path, cfn):\n        \"\"\"Check CloudFormation Properties\"\"\"\n        matches = []\n\n        matches.extend(\n            cfn.check_value(\n                obj=properties, key='DefinitionString',\n                path=path[:],\n                check_value=self.check_value,\n                check_sub=self.check_sub\n            ))\n\n        return matches\n", "path": "src/cfnlint/rules/resources/stepfunctions/StateMachine.py"}]}