Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(examples): Added DeepObject parameter handling to generate appropriate examples #64

Merged
merged 11 commits into from
Aug 13, 2024

Conversation

DotnDev
Copy link
Contributor

@DotnDev DotnDev commented Aug 5, 2024

The new filters format (using deepObject) needs to be supported by APITester to generate appropriate examples.

Copy link

github-actions bot commented Aug 5, 2024

Issued by Coverage Checker:

Coverage

❌ Your code coverage has been degraded 😭

Measure Main branch refs/pull/64/merge
Coverage 42.431% 42.281%
Total lines 3184 3200
Covered lines 1351 1353

∆ -0.150

🟢 ↗️ Improved files:

File On main branch refs/pull/64/merge
APITester/APITester/src/Util/Yaml.php 2 / 25 (8%) 3 / 27 (11.111%)

🔴 ↘️ Degraded files:

File On main branch refs/pull/64/merge
APITester/APITester/src/Definition/Example/OperationExample.php 229 / 289 (79.239%) 230 / 293 (78.498%)

@@ -22,7 +22,7 @@ public function getStatusCode(): ?string
return $this->statusCode;
}

public function setStatusCode(string|TaggedValue|null $statusCode): void
public function setStatusCode(string|TaggedValue|int|null $statusCode): void
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when the config only mentions a return code, it's treated as an int, not a TaggedValue

Comment on lines 18 to 30
public static function getFullPath(string $path): string
{
$dir = \dirname(__DIR__);

while (!in_array('vendor', \scandir($dir), true)) {
if ($dir === \dirname($dir)) {
return $dir . '/' . trim($path, '/');
}
$dir = \dirname($dir);
}

return $dir . '/' . trim($path, '/');
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Yaml::parseFile() was breaking as the path needs to be absolute

@@ -46,7 +46,7 @@ suites:
names: [ 'RangeConfig' ]
unit: items
- name: examples
extensionPath: tests/Fixtures/Examples/oc
extensionPath: 'tests/Fixtures/Examples/petstore/examples.new.yml'
Copy link
Contributor Author

@DotnDev DotnDev Aug 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using an existing file so the PlanTest.testOC() can work (the code related to the extension expects an 'operation' key and this file has one)

@DotnDev DotnDev force-pushed the chore_examples_add_param_deep_object_handling branch from b23d66a to 62772da Compare August 6, 2024 14:47
@DotnDev DotnDev requested a review from sidux August 6, 2024 14:49
@DotnDev DotnDev merged commit 9102388 into main Aug 13, 2024
3 of 4 checks passed
@DotnDev DotnDev deleted the chore_examples_add_param_deep_object_handling branch August 13, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants