Skip to content

How to document an array of strings? #147

Open
@Jeeppler

Description

@Jeeppler

I already looked at #87 and at spring-restdocs#505. I am using restDocsApiSpec: "0.10.0".

My API api/admin/users returns a JSON Array containing only strings: ["user1", "user2", "user3"].

What I currently get is:

api-admin-users1367467944:
  type: array
  items:
    type: object

the corresponding Java Code:

responseFields(
  fieldWithPath("[]").description("List of user Ids").optional()
).

What I want is:

api-admin-users1367467944:
  type: array
  items:
    type: string

Is there already a workaround for documenting an array of strings in ePages-de/restdoc-api-spec? Would somebody be willing to share an example on how to do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions