OpenAPI Swaggerドキュメント内のオブジェクト型は、FLOWのGUIでオブジェクト変数として表示されます。匿名オブジェクトとは、そのようなドキュメントで「オブジェクト」型として明示されているオブジェクトです。FLOWユーザーインタフェースでは、変数を定義するためのドロップダウンリストに匿名オブジェクトを表示できません。スクリプト内にそのようなオブジェクトを含むドキュメントは、インポートできないのでご注意ください。(FLOWへのドキュメントのインポートは、connect storm STUDIOを経由して実施できます。設定方法は、『connect storm STUDIOユーザーガイド』を参照してください)
例えば、以下のような定義を含むドキュメントはインポートできません。これは、「WeatherForecast」配列に(「object」として定義されている)匿名オブジェクトが含まれているためです。
{"type": "array","items":
{"type": "object","properties":
{"date":
{"type": "string", "format": "date-time"
},"temperatureC":
{"type": "integer", "format": "int32"
}
}
}
}
OpenAPI v3.0.0以上のSwaggerドキュメントを使用する場合は、以下のようにオリジナル版のSwaggerドキュメントを修正してインポートすると、本制限を回避できます。
オリジナル版は以下の通りです。黄色でハイライト表示されている部分を、その下の修正版でハイライト表示されているように置き換えてください。
{
"openapi": "3.0.1","info":
{"title": "WeatherForecast","version": "v1"
},"paths":
{"/WeatherForecast":
{"get":
{"tags": ["WeatherForecast"],"responses":
{"200":
{"description": "Success","content":
{"application/json":
{"schema":
{"type": "array","items":
{"type": "object","properties":
jjjjjjjjjjjjjjjjjjjjjjjj{"date":
jjjjjjjjjjjjjjjjjjjjjjjjjj{"type": "string", "format": "date-time"
jjjjjjjjjjjjjjjjjjjjjjjjjj},"temperatureC":
jjjjjjjjjjjjjjjjjjjjjjjjjjjj{"type": "integer", "format": "int32"
jjjjjjjjjjjjjjjjjjjjjjjjjjjj}
jjjjjjjjjjjjjjjjjjjjjjjj}
}
}
}
}
}
}
}
}
},
}
修正版は以下の通りです:上記オリジナル版に記述されていた匿名オブジェクトは、配列から削除されています。配列は、「object」型の名前付きスキーマコンポーネント「WeatherForecast」を参照するようになりました。
{
"openapi": "3.0.1","info":
{"title": "WeatherForecast","version": "v1"},"paths":
{"/WeatherForecast":
{"get":
{"tags": ["WeatherForecast"],"responses":
{"200":
{"description": "Success","content":
{"application/json":
{"schema":
{"type": "array","items":
{"$ref": "#/components/schemas/WeatherForecast"
}
}
}
}
}
}
}
}
},
jj"components":
jj{"schemas":
jjjj{"WeatherForecast":
jjjjjj{"type": "object","properties":
jjjjjjjj{"date":
jjjjjjjjjj{"type": "string","format": "date-time"
jjjjjjjjjj},"temperatureC":
jjjjjjjjjjjj{"type": "integer","format": "int32"
jjjjjjjjjjjj}
jjjjjjjj}
jjjjjj}
jjjj}
jj}
}
このように修正したSwaggerドキュメントを使用すると、「WeatherForecast」レスポンスの結果を、「WeatherForecast」オブジェクトに対応する配列型の変数(arrobjWeatherForecastなど)に格納できます。
これにより、配列変数を[REST API]アクションセルの出力として使用できるようになりました。