---
schema_version: "1"
id: 8525e2a6ae4e6d4cd5555d719e415ff7261cb6b3aecb2933bafeae2efc8e820c
title: objectFields
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.6/dw-types-functions-objectfields.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.6/dw-types-functions-objectfields
source_site: docs.mulesoft.com
content_type: documentation
content_hash: de72de97af35bd1ae6aa15644eddf0049fbb5ea7ffbdaf938d87600263f466f1
description: MuleSoft Documentation Site
release: "2.6"
latest: false
---
# objectFields

## [](#objectfields1)objectFields(t: Type): Array<Field>

特定の Object (オブジェクト) 型から項目の配列を返します。 データ型が Object (オブジェクト) 型でない場合、この関数は失敗します。

_DataWeave バージョン 2.3.0 で導入されました。_

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>t</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">関数型。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、さまざまな入力での ​`objectFields`​ の動作を示します。

#### [](#ソース)ソース

```DataWeave
import * from dw::core::Types
ns ns0 http://acme.com
type ADictionary = {_ : String}
type ASchema = {ns0#name @(ns0#foo: String): {}}
type AUser = {name @(foo?: String,l: Number)?: String, lastName*: Number}
---
{
    a: objectFields(ADictionary),
    b: objectFields(ASchema),
    c: objectFields(Object),
    d: objectFields(AUser)
}
```

#### [](#出力)出力

```Json
{
  "a": [
    {
      "key": {
        "name": {
          "localName": "_",
          "namespace": null
        },
        "attributes": [

        ]
      },
      "required": true,
      "repeated": false,
      "value": "String"
    }
  ],
  "b": [
    {
      "key": {
        "name": {
          "localName": "name",
          "namespace": "http://acme.com"
        },
        "attributes": [
          {
            "name": {
              "localName": "foo",
              "namespace": "http://acme.com"
            },
            "value": "String",
            "required": true
          }
        ]
      },
      "required": true,
      "repeated": false,
      "value": "Object"
    }
  ],
  "c": [

  ],
  "d": [
    {
      "key": {
        "name": {
          "localName": "name",
          "namespace": null
        },
        "attributes": [
          {
            "name": {
              "localName": "foo",
              "namespace": null
            },
            "value": "String",
            "required": false
          },
          {
            "name": {
              "localName": "l",
              "namespace": null
            },
            "value": "Number",
            "required": true
          }
        ]
      },
      "required": false,
      "repeated": false,
      "value": "String"
    },
    {
      "key": {
        "name": {
          "localName": "lastName",
          "namespace": null
        },
        "attributes": [

        ]
      },
      "required": true,
      "repeated": true,
      "value": "Number"
    }
  ]
}
```