mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			44 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!--
 | ||
|   Copyright JS Foundation and other contributors, http://js.foundation
 | ||
| 
 | ||
|   Licensed under the Apache License, Version 2.0 (the "License");
 | ||
|   you may not use this file except in compliance with the License.
 | ||
|   You may obtain a copy of the License at
 | ||
| 
 | ||
|   http://www.apache.org/licenses/LICENSE-2.0
 | ||
| 
 | ||
|   Unless required by applicable law or agreed to in writing, software
 | ||
|   distributed under the License is distributed on an "AS IS" BASIS,
 | ||
|   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | ||
|   See the License for the specific language governing permissions and
 | ||
|   limitations under the License.
 | ||
| -->
 | ||
| 
 | ||
| <script type="text/html" data-help-name="json">
 | ||
|     <p>JSON文字列とJavaScriptオブジェクトとの間で相互変換を行います。</p>
 | ||
|     <h3>入力</h3>
 | ||
|     <dl class="message-properties">
 | ||
|         <dt>payload<span class="property-type">オブジェクト | 文字列</span></dt>
 | ||
|         <dd>JavaScriptオブジェクトもしくはJSON文字列</dd>
 | ||
|         <dt>schema<span class="property-type">オブジェクト</span></dt>
 | ||
|         <dd>JSONの検証に利用するJSONスキーマ。設定されていない場合は検証を行いません。</dd>
 | ||
|     </dl>
 | ||
|     <h3>出力</h3>
 | ||
|     <dl class="message-properties">
 | ||
|         <dt>payload<span class="property-type">オブジェクト | 文字列</span></dt>
 | ||
|         <dd>
 | ||
|             <ul>
 | ||
|                 <li>入力が文字列の場合、JSONとして解釈し、JavaScriptオブジェクトに変換します。</li>
 | ||
|                 <li>入力がJavaScriptオブジェクトの場合、JSON文字列に変換します。JSON文字列は整形することも可能です。</li>
 | ||
|             </ul>
 | ||
|         </dd>
 | ||
|         <dt>schemaError<span class="property-type">配列</span></dt>
 | ||
|         <dd>JSONの検証でエラーが発生した場合、Catchノードを利用し、エラーを配列として<code>schemaError</code>プロパティから取得することができます。</dd>
 | ||
|     </dl>
 | ||
|     <h3>詳細</h3>
 | ||
|     <p>デフォルトの変換対象は<code>msg.payload</code>ですが、他のメッセージプロパティを変換対象とすることも可能です。</p>
 | ||
|     <p>双方向の変換を自動選択するのではなく、特定の変換のみ行うように設定できます。この機能は、例えば、<code>HTTP In</code>ノードに対するリクエストがcontent-typeを正しく設定していない場合であっても、JSONノードによる変換結果がJavaScriptオブジェクトであることを保証するために利用します。</p>
 | ||
|     <p>JSON文字列への変換が指定されている場合、受信した文字列に対してさらなるチェックは行いません。すなわち、文字列がJSONとして正しいかどうかの検査や、整形オプションを指定していたとしても整形処理を実施しません。</p>
 | ||
|     <p>JSONスキーマの詳細については、<a href="http://json-schema.org/latest/json-schema-validation.html">こちら</a>を参照してください。</p>
 | ||
| </script>
 |