English
Fx.json
About 401 wordsAbout 1 min
2026-01-09
Summary
The overview of this document is as follows: This document introduces the API definitions of Fx.json, usage methods, and related notes.
1. toJson Convert object to JSON string
Fx.json.toJson(<Object data>)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| data | Object | Object to be converted to JSON | Y |
Code examples
Fx.json.toJson(["a" : 1, "b" : 2]) // Returns: {"a":1,"b":2}2. toJson Convert object to JSON string with specified serialization features
Convert objects to JSON strings with specified serialization features
Fx.json.toJson(<Object data>, <SerializerFeature[] features>)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| data | Object | The object to be converted to JSON | Y |
| features | SerializerFeature[] | Variable arguments, list of serialization features | -- |
Code examples
Map m = ["a": 1, "b": null]
log.info(Fx.json.toJson(m))
log.info(Fx.json.toJson(m, SerializerFeature.WriteMapNullValue))3. parse JSON to Map
Convert JSON to Map
Fx.json.parse(<String data>)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| data | String | JSON string | Y |
Code examples
Map map = Fx.json.parse("{\"a\" : 1, \"b\" : 2}")4. parseList Convert JSON to List
Convert JSON to List
Fx.json.parseList(<String data>)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| data | String | JSON array string | Y |
Code examples
List list = Fx.json.parseList('[{"a": 1, "b": 2},{"a": 10, "b": 20}]')Notice
- The string here is a JSON array string, starting with "[" and ending with "]"
5. parseObject JSON to class conversion
Convert JSON to Class
Fx.json.parseObject(<String text>, <Class clazz>)
Request parameters
Request Body
| Parameter Name | Type | Description | Required |
|---|---|---|---|
| text | String | JSON string | Y |
| clazz | Class | Target type for conversion, e.g. List.class | Y |
Code examples
List tmp = Fx.json.parseObject('[{"a": 1, "b": 2},{"a": 10, "b": 20}]', List.class)Changelog
| Version | Date | Changes | Author |
|---|---|---|---|
| v1.0 | 2026-05-20 | Initial version |
Background
This document provides detailed information about the Fx.json API functionality and usage, helping developers integrate relevant capabilities.
Applicable Scenarios
Specific applicable scenarios are determined by actual business needs. Developers can select the appropriate API for integration as required.
Prerequisites
- Access to Fxiaoke Open Platform
- Application authorization and configuration completed
- Basic knowledge of relevant business domain
Steps
Please refer to the detailed instructions for each API.
Notes
- Ensure prerequisites are met before calling APIs
- Pay attention to API call frequency limits
- Refer to error code documentation for exception handling
Compatibility note: This version currently has no deprecated or compatibility notes.
