Skip to content

Allow the type of an array's scalar elements to be documented and enforced #505

Open
@Fleshgrinder

Description

@Fleshgrinder

Not sure if this is the right place to ask this question but maybe it directly translates to a feature request. Let our payload be as follows:

{
    "data": [
        "1",
        "2",
        "3",
        "",
        "n"
    ]
}

We can easily document the data property with the following code:

responseFields(fieldWithPath("data").type(JsonFieldType.ARRAY))

We know that every element is of type string and it is guaranteed that each element will be of type string; none of the following approaches work:

fieldWithPath("data.*").type(JsonFieldType.STRING)
fieldWithPath("data[].").type(JsonFieldType.STRING)
fieldWithPath("data[].*").type(JsonFieldType.STRING)
  • Is there a possibility to document the type?
  • What is your intended way to document something like this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementEnhancement that adds a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions