[spring-rest-docs]:记录地图时出现问题<Object, Set<Object>>

[spring-rest-docs]: Problem documenting a Map<Object, Set<Object>>

我很难记录以下内容:

{
  "virtualFaxPermissions" : {
    "SOME_RANDOM_UUID" : [ "SOME_SPECIFIC_PERMISSION" ]
  }
}

我试图引用我用来构建对象的同一张地图,但没有帮助:

final Map<VirtualFaxMachineId, Set<VirtualFaxMachinePermission>> virtualFaxPermissionsSetMap = new HashMap<>();
virtualFaxPermissionsSetMap.put(VirtualFaxMachineId.valueOf(SOME_RANDOM_UUID), Set.of(SOME_SPECIFIC_PERMISSION));
user.setVirtualFaxPersmission(virtualFaxPermissionsSetMap);
.....
fieldWithPath("virtualFaxPermissions").description(virtualFaxPermissionsSetMap)

我得到的错误是上面的部分没有记录在有效载荷中。

org.springframework.restdocs.snippet.SnippetException: The following parts of the payload were not documented:
{
  "virtualFaxPermissions" : {
    "RANDOM_UUID_GENERATED" : [ "REQUESTED_PERMISSION" ]
  }
}

at org.springframework.restdocs.payload.AbstractFieldsSnippet.validateFieldDocumentation(AbstractFieldsSnippet.java:218)

我曾尝试使用 UUDI 通配符进行记录,但这也无济于事

感谢指点

根据: https://github.com/spring-projects/spring-restdocs/issues/793

正在使用 subsectionWithPath("virtualFaxPermissions")

成功了