Skip to content

Commit

Permalink
Merge pull request #177 from rapid7/soar-16333-validator-fix
Browse files Browse the repository at this point in the history
SOAR-16333 - Fix help.md replacing quotes
  • Loading branch information
cmcnally-r7 authored Jan 22, 2024
2 parents 2626b6c + 2015048 commit 49fdcde
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ be on your way to contributing!

## Changelog

* 2.47.13 - `HelpInputOutputValidator` - Fix validator to change single quotes to double quotes when an input field uses list values so that it does not break
* 2.47.12 - `VersionBumpValidator` - update validation for connection versions| Updated `GitPython` to version 3.1.41.
* 2.47.11 - Update PyYaml version to fix unrelated tooling installation bug.
* 2.47.10 - `HelpInputOutputValidator` - Improved error messaging around invalid action/trigger/task headings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,13 @@ def get_spec_input(input_content: dict) -> list:
else:
if isinstance(example, list):
example = f"{example}".replace("'", '"')

if isinstance(default_, list):
default_ = f"{default_}".replace("'", '"')

if isinstance(enum, list):
enum = f"{enum}".replace("'", '"')

action_input.append(
f"|{name_}|{type_}|{default_}|{required}|{description}|{enum}|{example}|"
)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="insightconnect_integrations_validators",
version="2.47.12",
version="2.47.13",
description="Validator tooling for InsightConnect integrations",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
10 changes: 5 additions & 5 deletions unit_test/plugin_examples/good_datetime_example/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Example input:

#### Create Ticket

This action is used to create a FreshDesk ticket. At least one of those parameters must be provided - 'requesterId', 'email', 'phone', 'twitterId', 'uniqueExternalId'.
This action is used to create a FreshDesk ticket. At least one of those parameters must be provided - "requesterId", "email", "phone", "twitterId", "uniqueExternalId".

##### Input

Expand Down Expand Up @@ -197,7 +197,7 @@ This action is used to get ticket details.

|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|include|string|None|False|Include additional ticket informations|['conversations', 'requester', 'company', 'stats', 'None']|company|
|include|string|None|False|Include additional ticket informations|["conversations", "requester", "company", "stats", "None"]|company|
|ticketId|integer|None|True|ID of the Ticket|None|178|

Example input:
Expand Down Expand Up @@ -287,9 +287,9 @@ This action is used to get tickets list. In `filterBy` input you can use only on
|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|filterBy|ticketsFilter|None|False|Filter tickets by a specific fields|None|{"requesterId": 54332121123}|
|include|string|None|False|Include additional ticket informations|['requester', 'company', 'stats', 'None']|company|
|orderBy|string|None|False|Order tickets by specific field|['created_at', 'due_by', 'updated_at', 'status']|status|
|orderType|string|None|False|Type of the order|['asc', 'desc']|asc|
|include|string|None|False|Include additional ticket informations|["requester", "company", "stats", "None"]|company|
|orderBy|string|None|False|Order tickets by specific field|["created_at", "due_by", "updated_at", "status"]|status|
|orderType|string|None|False|Type of the order|["asc", "desc"]|asc|
|page|integer|None|False|Page number|None|3|
|perPage|integer|None|False|Results per page. Less or equal to 100|None|12|
|predefinedFilter|string|None|False|The various filters available are new_and_my_open, watching, spam, deleted|None|new_and_my_open|
Expand Down
2 changes: 1 addition & 1 deletion unit_test/plugin_examples/good_plugin/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This action is used to decode Base64 to data.
|Name|Type|Default|Required|Description||Enum|Example|
|----|----|-------|--------|-----------|-----|-------|
|base64|bytes|None|True|Data to decode|None|base64|
|errors|string|nothing|False|How errors should be handled when decoding Base64|['replace', 'ignore', 'nothing']|replace|
|errors|string|nothing|False|How errors should be handled when decoding Base64|["replace", "ignore", "nothing"]|replace|

Example input:

Expand Down
4 changes: 2 additions & 2 deletions unit_test/plugin_examples/good_plugin_with_task/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ This action is used to decode Base64 to data.
|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|base64|bytes|None|True|Data to decode|None|==Md|
|errors|string|nothing|False|How errors should be handled when decoding Base64|['replace', 'ignore', 'nothing']|replace|
|errors|string|nothing|False|How errors should be handled when decoding Base64|["replace", "ignore", "nothing"]|replace|

Example input:

Expand Down Expand Up @@ -112,7 +112,7 @@ Supported schedule types for this task include:
|Name|Type|Default|Required|Description|Enum|Example|
|----|----|-------|--------|-----------|----|-------|
|base64|bytes|None|True|Data to decode|None|1234|
|errors|string|nothing|False|How errors should be handled when decoding Base64|['replace', 'ignore', 'nothing']|replace|
|errors|string|nothing|False|How errors should be handled when decoding Base64|["replace", "ignore", "nothing"]|replace|

Example input:

Expand Down

0 comments on commit 49fdcde

Please sign in to comment.