sage/apitools/README.md
2025-07-16 14:28:41 +08:00

51 lines
983 B
Markdown

# API tools
this tool read api specific file in json format, and generates python code
## json file format
{
"apiname":API name
"title":API descriptions
"description":
"data":{
}
mapis:{
methodname:mapi #each methos a key
}
}
mapi has following format
{
"title":name of the api
"descriptions":"description of the api
"url":call url for this api
"method":http method
"headers":haed need to set to
"params":data will sent to api server
"response_type":json, file,
"response_error_type":"json"
"response":resposne return from api server
"error_field":
"error_text_field":
"returnData":[
{
"field":"sssss",
"name":"ggggg"
}
]
}
## header, params, response format
{
name:
type:
required:
value:
description
}
## data in json file
Use ${name} format to refer the data in API's data object,
if name is not in data, replace ${name} as ""
## method call logic
this tool just build all the method api function for coder, and not call logic implement