Support multiple types on a field descriptor and assert that actual type matches one of them

Open
#352 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, spring

Research direction

Start by tracing the implementation behind fieldWithPath("uid").type(...) and how JsonFieldType is currently asserted. Define completion as accepting multiple permitted types while rejecting actual JSON types that match none of them, and verify the behavior with the relevant existing assertion tests.

Written by the indexing model from the issue text.

Description

type: enhancement

The following code produce a nice output in the type column, but It does not perform the assertion:

fieldWithPath("uid").type(Arrays.asList(JsonFieldType.STRING, JsonFieldType.NULL));

Is there a better way to do it?
Would you accept a pull request about this?

Dominant language
Java
Stars
1.2k
Forks
731
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from spring-projects/spring-restdocs

All issues in spring-projects/spring-restdocs

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.