Dart服务API:如何通过API服务访问/修复?
我正在看: 我正在尝试调整给出的示例()以从“/api/dartservices/v1/fixes”而不是“/api/dartservices/v1/analyze”中提取信息 抱歉,如果我在这里遗漏了一些明显的内容,但将示例中的路径更改为: “ 返回一个错误。有人知道我如何从“/api/dartservices/v1/fixes”而不是“/api/dartservices/v1/analyze”获取信息吗?或者有人有这样的例子吗Dart服务API:如何通过API服务访问/修复?,dart,dart-pub,Dart,Dart Pub,我正在看: 我正在尝试调整给出的示例()以从“/api/dartservices/v1/fixes”而不是“/api/dartservices/v1/analyze”中提取信息 抱歉,如果我在这里遗漏了一些明显的内容,但将示例中的路径更改为: “ 返回一个错误。有人知道我如何从“/api/dartservices/v1/fixes”而不是“/api/dartservices/v1/analyze”获取信息吗?或者有人有这样的例子吗 谢谢。向https://dart-services.appsp
谢谢。向
https://dart-services.appspot.com/api/dartservices/v1/fixes
使用DartPad示例发送的数据生成错误消息“缺少参数:‘偏移量’”
查看服务的发现文档,我看到analyze
和fixes
操作执行SourceRequest
:
"SourceRequest": {
"id": "SourceRequest",
"type": "object",
"properties": {
"source": {
"type": "string",
"description": "The Dart source.",
"required": true
},
"offset": {
"type": "integer",
"description": "An optional offset into the source code.",
"format": "int32"
},
"strongMode": {
"type": "boolean",
"description": "An optional signal whether the source should be processed in strong mode"
}
}
offset
未按要求标记,因此在fixes
wrt该参数的实现中可能存在错误
要使DartPad示例正常工作,请更改:
Map m = {'source': textArea.value};
到
返回的错误是什么?
Map m = {'source': textArea.value, 'offset': 0};