Preserve empty JSON schema object maps#234
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #234 +/- ##
============================================
+ Coverage 88.12% 88.21% +0.08%
- Complexity 1213 1225 +12
============================================
Files 60 60
Lines 3934 3963 +29
============================================
+ Hits 3467 3496 +29
Misses 467 467
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
FunctionDeclarationthat preserves empty JSON Schema object-map fields as{}.FunctionDeclaration::jsonSerialize()to use the safe parameter representation.Fixes #233.
Testing
vendor/bin/phpunit tests/unit/Tools/DTO/FunctionDeclarationTest.php --filter testJsonSerializationPreservesEmptySchemaObjectMapsvendor/bin/phpunit tests/unit/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleTextGenerationModelTest.php --filter testPrepareToolsParamPreservesEmptySchemaObjectMapsvendor/bin/phpunit tests/unit/Tools/DTO/FunctionDeclarationTest.phpvendor/bin/phpunit tests/unit/Providers/OpenAiCompatibleImplementation/AbstractOpenAiCompatibleTextGenerationModelTest.phpcomposer phpcscomposer phpstanAI assistance