Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用SpringDataRest架构确定属性是否为集合_Java_Spring_Spring Data_Spring Data Rest - Fatal编程技术网

Java 使用SpringDataRest架构确定属性是否为集合

Java 使用SpringDataRest架构确定属性是否为集合,java,spring,spring-data,spring-data-rest,Java,Spring,Spring Data,Spring Data Rest,我正在构建一个动态适应spring数据rest端点的客户机/代码生成器 我通过两个请求请求模式信息: curl -v -H "Accept: application/schema+json" http://localhost:8080/legalEntity curl -v -H "Accept: application/hal+json" http://localhost:8080/legalEntity 这给了我一个ApiLegalEntity的模式。特别是,我对这个实体的一个子属性感兴趣

我正在构建一个动态适应spring数据rest端点的客户机/代码生成器

我通过两个请求请求模式信息:

curl -v -H "Accept: application/schema+json" http://localhost:8080/legalEntity
curl -v -H "Accept: application/hal+json" http://localhost:8080/legalEntity
这给了我一个
ApiLegalEntity
的模式。特别是,我对这个实体的一个子属性感兴趣,我知道它是一个
列表
。对于schema,我得到:

{
  "title": "Api legal entity",
  "properties": {
    "accounts": {
      "title": "Accounts",
      "readOnly": true,
      "type": "string",
      "format": "uri"
    },
    ...
  },
  "definitions": {},
  "type": "object",
  "$schema": "http://json-schema.org/draft-04/schema#"
}
到目前为止,除了财产名称,我无法破译任何东西,但幸运的是,哈尔告诉我(几乎)其他一切:

{
  "alps": {
    "version": "1.0",
    "descriptors": [
      {
        "id": "legalentities-representation",
        "href": "http://.../profile/legalentities",
        ...
        "descriptors": [
          {
            "name": "accounts",
            "type": "SAFE",
            "rt": "http://.../#accounts-representation"
          },
          ...
        ]
      },
      {
        "id": "get-legalentities",
       ...
      },
     ]
  }
}
太好了!现在从
“rt”:http://.../#accounts-表示“
我知道
accounts
属性是一个
apaccount
实体。现在,我如何判断这是一个帐户集合