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

[BUGFIX] Convert non-list arrays in API response #85

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

eliashaeussler
Copy link
Member

This PR fixes an issue if converted API responses differ from the expected array structure used to parse and map responses to objects. This may happen if only one position is included in the response or if only one job description is included.

With this PR, an appropriate mapper source is introduced which converts those array paths to lists, ensuring a clean array structure.

Resolves: #81

@eliashaeussler eliashaeussler added the bug Something isn't working label Aug 16, 2023
@eliashaeussler eliashaeussler self-assigned this Aug 16, 2023
@codeclimate
Copy link

codeclimate bot commented Aug 16, 2023

Code Climate has analyzed commit be5624b and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 12.2% (12.2% change).

View more on Code Climate.

@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #85 (be5624b) into develop (26407a3) will increase coverage by 12.23%.
The diff coverage is 100.00%.

@@              Coverage Diff               @@
##             develop      #85       +/-   ##
==============================================
+ Coverage       0.00%   12.23%   +12.23%     
- Complexity       222      241       +19     
==============================================
  Files             28       32        +4     
  Lines            721      793       +72     
==============================================
+ Hits               0       97       +97     
+ Misses           721      696       -25     
Files Changed Coverage Δ
Classes/Service/PersonioImportService.php 0.00% <ø> (ø)
Classes/Exception/InvalidArrayPathException.php 100.00% <100.00%> (ø)
Classes/Exception/MalformedXmlException.php 100.00% <100.00%> (ø)
Classes/Mapper/Source/XmlSource.php 100.00% <100.00%> (ø)
Classes/Service/PersonioApiService.php 75.00% <100.00%> (+75.00%) ⬆️
Classes/Utility/ArrayUtility.php 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@eliashaeussler eliashaeussler merged commit 973a637 into develop Aug 16, 2023
15 checks passed
@eliashaeussler eliashaeussler deleted the fix/xml-mapping branch August 16, 2023 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant