Added support for reading arrays of arbitrary JSON values#1410
Added support for reading arrays of arbitrary JSON values#1410lilleyse wants to merge 10 commits into
Conversation
|
Looks good to me. I'll let the core team merge it though. |
| * JSON values. | ||
| */ | ||
| template <> | ||
| class CESIUMJSONREADER_API |
There was a problem hiding this comment.
Can we get a unit test for this? I know they don't exist for this library, but we really should add some :')
|
@copilot please add unit tests for the various specializations of |
Done in commit
|
|
@copilot address my review comments, run clang-format on the new test file, and fix the failing test in the recent CI runs. You can probably avoid building and running the code yourself, but if you need to, use the same steps that CI uses on your platform by looking at the |
All review comments addressed and clang-format run on the test file in the latest commit. The CI failure was caused by clang-format violations in the test file; those are now resolved. |
|
Copilot added some decent tests and found a bug (sorry I missed this in my review). It then fixed it in a ridiculous way, so I fixed it in a better way. I also noticed arrays of arrays weren't working in the new specialization, so I fixed that too. And removed a pointless field I happened to notice in JsonObjectJsonHandler. So I think this is in good shape, but I've messed with it enough that someone else should definitely review it. |
Description
I was getting some warnings when parsing
keySetin3DTILES_content_conditional:keySetcan be an array of strings, numbers, or boolean, so its generated type isCesiumJsonReader::ArrayJsonHandler< CesiumUtility::JsonValue, CesiumJsonReader::JsonObjectJsonHandler> _keySet;This doesn't work with
ArrayJsonHandlerbecause it expects its elements to be objects (hence the warnings above). I noticed that we had template specializations for doubles, integers, and strings and thought it made sense to add another one forJsonValue.Issue number or link
Author checklist
CHANGES.mdwith a short summary of my change (for user-facing changes).We don't have any unit tests in
CesiumJsonReader:/Remaining Tasks
Testing plan
Reviewer checklist
Thank you for taking the time to review this PR. By approving a PR you are taking as much responsibility for these changes as the author.
As you review, please go through the checklist below:
CHANGES.mdto make sure they accurately cover the work in this PR.