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

Add support for converting the whole JSON document without using JSONPath #33018

Closed
snicoll opened this issue Jun 12, 2024 · 0 comments
Closed
Assignees
Labels
in: test Issues in the test module type: enhancement A general enhancement
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Jun 12, 2024

The AssertJ support lets us convert the result of an expression to a target object, something like:

assertThat(mvc.get().uri(/family)).bodyJson().extractingPath("$.familyMembers[0]").convertTo(Member.class)

It's not possible to do the same thing when the whole document should be converted. We can workaround at the moment as follows:

assertThat(mvc.get().uri(/family/0)).bodyJson().extractingPath("$").convertTo(Member.class)

This requires JSONPath for not good reason and requires more boilerplate than it should ideally.

@snicoll snicoll added type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Jun 12, 2024
@snicoll snicoll added this to the 6.2.x milestone Jun 12, 2024
@snicoll snicoll self-assigned this Jun 12, 2024
@snicoll snicoll modified the milestones: 6.2.x, 6.2.0-M4 Jun 12, 2024
@snicoll snicoll added in: test Issues in the test module and removed theme: aot An issue related to Ahead-of-time processing labels Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant