This repository was archived by the owner on Jul 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +178
-1
lines changed
de/docusaurus-plugin-content-docs/current/configuration
en/docusaurus-plugin-content-docs/current/configuration
es/docusaurus-plugin-content-docs/current/configuration
fr/docusaurus-plugin-content-docs/current/configuration
hi/docusaurus-plugin-content-docs/current/configuration
ja/docusaurus-plugin-content-docs/current/configuration
ko/docusaurus-plugin-content-docs/current/configuration Expand file tree Collapse file tree 9 files changed +178
-1
lines changed Original file line number Diff line number Diff line change @@ -19,4 +19,5 @@ npm-debug.log*
1919yarn-debug.log *
2020yarn-error.log *
2121
22- .cursor /
22+ .cursor /
23+ temp
Original file line number Diff line number Diff line change @@ -103,6 +103,23 @@ responseBody: |-
103103endpoint: "http://localhost:5236/users/{{.Args.email}}/preferences"
104104` ` `
105105
106+ # ## 8. 处理复杂对象数据
107+
108+ 当需要将请求或者响应的对象、数组之类的复杂结构转成JSON的话,可以使用 `toJSON` 函数:
109+
110+ ` ` ` yaml
111+ requestBody: |-
112+ {
113+ "isPublic": {{.Args.isPublic}},
114+ "showEmail": {{.Args.showEmail}},
115+ "theme": "{{.Args.theme}}",
116+ "tags": {{.Args.tags}},
117+ "settings": {{ toJSON .Args.settings }}
118+ }
119+ ` ` `
120+
121+ 此处的`settings`是一个复杂对象,使用`toJSON`函数后,会自动将`settings`转换为JSON字符串
122+
106123# # 内置函数
107124
108125目前支持以下内置函数:
@@ -122,6 +139,11 @@ endpoint: "http://localhost:5236/users/{{.Args.email}}/preferences"
122139 {{- $rows := fromJSON .Response.Data.rows }}
123140 ` ` `
124141
142+ 4. `toJSON` : 将对象转换为 JSON 字符串
143+ ` ` ` yaml
144+ "settings": {{ toJSON .Args.settings }}
145+ ` ` `
146+
125147如果需要添加新的模板函数,可以
1261481. 描述具体的使用场景,创建 issue 说明需求
1271493. 欢迎实现后PR,但目前只接受通用用途的函数
Original file line number Diff line number Diff line change @@ -103,6 +103,23 @@ Dieses Beispiel zeigt:
103103endpoint: "http://localhost:5236/users/{{.Args.email}}/preferences"
104104` ` `
105105
106+ # ## 8. Komplexe Objektdaten verarbeiten
107+
108+ Wenn Sie komplexe Strukturen wie Objekte oder Arrays in Anfragen oder Antworten in JSON umwandeln müssen, können Sie die Funktion `toJSON` verwenden :
109+
110+ ` ` ` yaml
111+ requestBody: |-
112+ {
113+ "isPublic": {{.Args.isPublic}},
114+ "showEmail": {{.Args.showEmail}},
115+ "theme": "{{.Args.theme}}",
116+ "tags": {{.Args.tags}},
117+ "settings": {{ toJSON .Args.settings }}
118+ }
119+ ` ` `
120+
121+ In diesem Fall ist `settings` ein komplexes Objekt, das mit der Funktion `toJSON` automatisch in einen JSON-String umgewandelt wird.
122+
106123# # Eingebaute Funktionen
107124
108125Aktuell unterstützte eingebaute Funktionen :
@@ -122,6 +139,11 @@ Aktuell unterstützte eingebaute Funktionen:
122139 {{- $rows := fromJSON .Response.Data.rows }}
123140 ` ` `
124141
142+ 4. `toJSON` : Objekt in JSON-String konvertieren
143+ ` ` ` yaml
144+ "settings": {{ toJSON .Args.settings }}
145+ ` ` `
146+
125147Um neue Template-Funktionen hinzuzufügen :
1261481. Spezifischen Anwendungsfall beschreiben und ein Issue erstellen
1271492. PR-Beiträge sind willkommen, aber derzeit werden nur allgemeine Funktionen akzeptiert
Original file line number Diff line number Diff line change @@ -103,6 +103,23 @@ This example demonstrates:
103103endpoint: "http://localhost:5236/users/{{.Args.email}}/preferences"
104104` ` `
105105
106+ # ## 8. Handling Complex Object Data
107+
108+ When you need to convert complex structures like objects or arrays in requests or responses to JSON, you can use the `toJSON` function :
109+
110+ ` ` ` yaml
111+ requestBody: |-
112+ {
113+ "isPublic": {{.Args.isPublic}},
114+ "showEmail": {{.Args.showEmail}},
115+ "theme": "{{.Args.theme}}",
116+ "tags": {{.Args.tags}},
117+ "settings": {{ toJSON .Args.settings }}
118+ }
119+ ` ` `
120+
121+ In this case, `settings` is a complex object that will be automatically converted to a JSON string using the `toJSON` function.
122+
106123# # Built-in Functions
107124
108125Currently supported built-in functions :
@@ -122,6 +139,11 @@ Currently supported built-in functions:
122139 {{- $rows := fromJSON .Response.Data.rows }}
123140 ` ` `
124141
142+ 4. `toJSON` : Convert an object to a JSON string
143+ ` ` ` yaml
144+ "settings": {{ toJSON .Args.settings }}
145+ ` ` `
146+
125147To add new template functions :
1261481. Describe the specific use case and create an issue
1271492. Welcome PR contributions, but currently only accepting general-purpose functions
Original file line number Diff line number Diff line change @@ -103,6 +103,23 @@ Este ejemplo demuestra:
103103endpoint: "http://localhost:5236/users/{{.Args.email}}/preferences"
104104` ` `
105105
106+ # ## 8. Manejar datos de objetos complejos
107+
108+ Cuando necesites convertir estructuras complejas como objetos o arrays en solicitudes o respuestas a JSON, puedes usar la función `toJSON` :
109+
110+ ` ` ` yaml
111+ requestBody: |-
112+ {
113+ "isPublic": {{.Args.isPublic}},
114+ "showEmail": {{.Args.showEmail}},
115+ "theme": "{{.Args.theme}}",
116+ "tags": {{.Args.tags}},
117+ "settings": {{ toJSON .Args.settings }}
118+ }
119+ ` ` `
120+
121+ En este caso, `settings` es un objeto complejo que será convertido automáticamente a una cadena JSON usando la función `toJSON`.
122+
106123# # Funciones incorporadas
107124
108125Funciones incorporadas actualmente soportadas :
@@ -122,6 +139,11 @@ Funciones incorporadas actualmente soportadas:
122139 {{- $rows := fromJSON .Response.Data.rows }}
123140 ` ` `
124141
142+ 4. `toJSON` : Convertir un objeto a cadena JSON
143+ ` ` ` yaml
144+ "settings": {{ toJSON .Args.settings }}
145+ ` ` `
146+
125147Para agregar nuevas funciones de plantilla :
1261481. Describir el caso de uso específico y crear un issue
1271492. Se aceptan contribuciones PR, pero actualmente solo se aceptan funciones de propósito general
Original file line number Diff line number Diff line change @@ -103,6 +103,23 @@ Cet exemple démontre :
103103endpoint: "http://localhost:5236/users/{{.Args.email}}/preferences"
104104` ` `
105105
106+ # ## 8. Traitement des données d'objets complexes
107+
108+ Lorsque vous devez convertir des structures complexes comme des objets ou des tableaux dans les requêtes ou les réponses en JSON, vous pouvez utiliser la fonction `toJSON` :
109+
110+ ` ` ` yaml
111+ requestBody: |-
112+ {
113+ "isPublic": {{.Args.isPublic}},
114+ "showEmail": {{.Args.showEmail}},
115+ "theme": "{{.Args.theme}}",
116+ "tags": {{.Args.tags}},
117+ "settings": {{ toJSON .Args.settings }}
118+ }
119+ ` ` `
120+
121+ Dans ce cas, `settings` est un objet complexe qui sera automatiquement converti en chaîne JSON à l'aide de la fonction `toJSON`.
122+
106123# # Fonctions intégrées
107124
108125Fonctions intégrées actuellement supportées :
@@ -122,6 +139,11 @@ Fonctions intégrées actuellement supportées :
122139 {{- $rows := fromJSON .Response.Data.rows }}
123140 ` ` `
124141
142+ 4. `toJSON` : Convertir un objet en chaîne JSON
143+ ` ` ` yaml
144+ "settings": {{ toJSON .Args.settings }}
145+ ` ` `
146+
125147Pour ajouter de nouvelles fonctions de template :
1261481. Décrire le cas d'utilisation spécifique et créer un issue
1271492. Les contributions PR sont les bienvenues, mais seules les fonctions à usage général sont actuellement acceptées
Original file line number Diff line number Diff line change @@ -103,6 +103,23 @@ responseBody: |-
103103endpoint: "http://localhost:5236/users/{{.Args.email}}/preferences"
104104` ` `
105105
106+ # ## 8. जटिल ऑब्जेक्ट डेटा का संचालन
107+
108+ जब आपको अनुरोध या प्रतिक्रियाओं में ऑब्जेक्ट या एरे जैसी जटिल संरचनाओं को JSON में बदलने की आवश्यकता होती है, तो आप `toJSON` फ़ंक्शन का उपयोग कर सकते हैं :
109+
110+ ` ` ` yaml
111+ requestBody: |-
112+ {
113+ "isPublic": {{.Args.isPublic}},
114+ "showEmail": {{.Args.showEmail}},
115+ "theme": "{{.Args.theme}}",
116+ "tags": {{.Args.tags}},
117+ "settings": {{ toJSON .Args.settings }}
118+ }
119+ ` ` `
120+
121+ इस मामले में, `settings` एक जटिल ऑब्जेक्ट है जिसे `toJSON` फ़ंक्शन का उपयोग करके स्वचालित रूप से JSON स्ट्रिंग में बदल दिया जाएगा।
122+
106123# # अंतर्निहित फ़ंक्शन
107124
108125वर्तमान में समर्थित अंतर्निहित फ़ंक्शन :
@@ -122,6 +139,11 @@ endpoint: "http://localhost:5236/users/{{.Args.email}}/preferences"
122139 {{- $rows := fromJSON .Response.Data.rows }}
123140 ` ` `
124141
142+ 4. `toJSON` : ऑब्जेक्ट को JSON स्ट्रिंग में बदलें
143+ ` ` ` yaml
144+ "settings": {{ toJSON .Args.settings }}
145+ ` ` `
146+
125147नए टेम्पलेट फ़ंक्शन जोड़ने के लिए :
1261481. विशिष्ट उपयोग के मामले का वर्णन करें और एक issue बनाएं
1271492. PR योगदान का स्वागत है, लेकिन वर्तमान में केवल सामान्य उद्देश्य वाले फ़ंक्शन स्वीकार किए जाते हैं
Original file line number Diff line number Diff line change @@ -103,6 +103,23 @@ responseBody: |-
103103endpoint: "http://localhost:5236/users/{{.Args.email}}/preferences"
104104` ` `
105105
106+ # ## 8. 複雑なオブジェクトデータの処理
107+
108+ リクエストやレスポンスの複雑なオブジェクトや配列などの構造をJSONに変換する必要がある場合は、`toJSON`関数を使用できます:
109+
110+ ` ` ` yaml
111+ requestBody: |-
112+ {
113+ "isPublic": {{.Args.isPublic}},
114+ "showEmail": {{.Args.showEmail}},
115+ "theme": "{{.Args.theme}}",
116+ "tags": {{.Args.tags}},
117+ "settings": {{ toJSON .Args.settings }}
118+ }
119+ ` ` `
120+
121+ この場合、`settings`は複雑なオブジェクトであり、`toJSON`関数を使用すると自動的にJSON文字列に変換されます。
122+
106123# # 組み込み関数
107124
108125現在サポートされている組み込み関数:
@@ -122,6 +139,11 @@ endpoint: "http://localhost:5236/users/{{.Args.email}}/preferences"
122139 {{- $rows := fromJSON .Response.Data.rows }}
123140 ` ` `
124141
142+ 4. `toJSON` : オブジェクトをJSON文字列に変換
143+ ` ` ` yaml
144+ "settings": {{ toJSON .Args.settings }}
145+ ` ` `
146+
125147新しいテンプレート関数を追加するには:
1261481. 具体的な使用例を説明し、issue を作成
1271492. PR の貢献を歓迎しますが、現在は汎用的な関数のみを受け付けています
Original file line number Diff line number Diff line change @@ -103,6 +103,23 @@ responseBody: |-
103103endpoint: "http://localhost:5236/users/{{.Args.email}}/preferences"
104104` ` `
105105
106+ # ## 8. 복잡한 객체 데이터 처리
107+
108+ 요청이나 응답의 복잡한 객체, 배열과 같은 구조를 JSON으로 변환해야 할 때는 `toJSON` 함수를 사용할 수 있습니다 :
109+
110+ ` ` ` yaml
111+ requestBody: |-
112+ {
113+ "isPublic": {{.Args.isPublic}},
114+ "showEmail": {{.Args.showEmail}},
115+ "theme": "{{.Args.theme}}",
116+ "tags": {{.Args.tags}},
117+ "settings": {{ toJSON .Args.settings }}
118+ }
119+ ` ` `
120+
121+ 이 경우, `settings`는 복잡한 객체로, `toJSON` 함수를 사용하면 자동으로 JSON 문자열로 변환됩니다.
122+
106123# # 내장 함수
107124
108125현재 지원되는 내장 함수 :
@@ -122,6 +139,11 @@ endpoint: "http://localhost:5236/users/{{.Args.email}}/preferences"
122139 {{- $rows := fromJSON .Response.Data.rows }}
123140 ` ` `
124141
142+ 4. `toJSON` : 객체를 JSON 문자열로 변환
143+ ` ` ` yaml
144+ "settings": {{ toJSON .Args.settings }}
145+ ` ` `
146+
125147새로운 템플릿 함수를 추가하려면 :
1261481. 구체적인 사용 사례를 설명하고 issue 생성
1271492. PR 기여를 환영하지만, 현재는 일반적인 용도의 함수만 수락합니다
You can’t perform that action at this time.
0 commit comments