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

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

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

_DataWeave 2.3.0 で導入されました。Mule 4.3 以降でサポートされます。_​

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

<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">t</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"
    }
  ]
}
```