Skip to content

Commit

Permalink
correctly extract the description for payment_options from the free-f…
Browse files Browse the repository at this point in the history
…orm invoice endpoint description
  • Loading branch information
xavierlacot committed Aug 17, 2023
1 parent 0f8c74b commit 9515a1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion generated/harvest-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6446,7 +6446,7 @@ paths:
nullable: true
payment_options:
type: array
description: "\_"
description: 'The payment options available to pay the invoice. Your account must be configured with the appropriate options under Settings > Integrations > Online payment to assign them. Options: [ach, credit_card, paypal]'
nullable: true
items:
type: string
Expand Down
12 changes: 10 additions & 2 deletions src/Extractor/Extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,16 @@ public static function buildRequestBody($method, $path, $explicitParameters, $ex
$$columnName = array_shift($explicitParameters);
}

if (isset($required) && 'required' === $required) {
$requiredProperties[] = $parameter;
if (isset($required)) {
if ('*optional' === $required) {
$required = 'optional';
}

if ('required' === $required) {
$requiredProperties[] = $parameter;
} else if (!\in_array($required, ['optional', 'required'])) {
$description = $required;
}
}

$property = self::buildDefinitionProperty($parameter, $type, $description, $path, $method);
Expand Down

0 comments on commit 9515a1e

Please sign in to comment.