如何将API文档转换为窗口小部件 [英] How to convert an API document into a widget

查看:79
本文介绍了如何将API文档转换为窗口小部件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个API文档,我应该把它变成一个更像用户友好的插件,就像一个小部件。



你是怎么做到的?



这是一个代码示例;

POST / message?key = [KEY]& performerId = [id]& customerId = [id]& nickname = [nickname] HTTP / 1.1

Host :[API]:80



[留言]



参数

名称必填类型说明

key是字符串由VS提供。请告诉我们您的密钥。

performerId是整数聊天应该出现在其房间中的表演者的身份。

customerId否整数客户的唯一ID。如果没有提供id,则认为这是未注册的客户。

昵称是字符串此用户在聊天中显示的名称。

post-data是字符串这是客户希望对房间说的消息(最多200个字符)。

示例响应

HTTP / 1.1 200 OK

Content-Type:text / xml; charset = utf-8

内容长度:[int]



{

成功:true | false

消息:[string]

}

响应参数

名称描述

成功无论您的帖子是否成功。

message如果成功为假,则显示错误消息。







我尝试了什么:



我的API文档是不同的请求和响应然而,它们在细节上似乎相当渺茫,导致开发人员在集成时花费大量时间。是不是有办法获取这些文档并创建一个更加用户友好的插件或模板,开发人员可以更容易使用?

I have this API documentation and am supposed to make into a more user-friendly plugin like a widget.

How do you do that?

Here’s a sample of the code;
POST /message?key=[KEY]&performerId=[id]&customerId=[id]&nickname=[nickname] HTTP/1.1
Host: [API]:80

[message]

Parameters
Name Required Type Description
key Yes string Supplied by VS. Please ask us for your key.
performerId Yes integer The id of the performer in whose room the chat should appear.
customerId No integer The unique id of the customer. If no id is provided, it is assumed that this is an unregistered customer.
nickname Yes string The name that this user will appear as in the chat.
post-data Yes string This is the message that the customer wishes to say to the room (max 200 chars).
Example Response
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: [int]

{
success: true | false
message: [string]
}
Response Parameters
Name Description
success Whether or not your post was successful.
message An error message if success is false.



What I have tried:

I ahve the API documentation for different Requests and Responses however they seem rather slim in the details causing developers to spend a lot of time when integrating. Isn't there a way to take these docs and create a more user friendly plugin or template that a developer could more easily use?

推荐答案

如果我理解你的问题正确地说,你的问题是你有很难阅读/理解的API文档,而且缺乏细节,但你想将它转换成更友好的用户格式,以帮助开发人员自助吗?



我建议查看一些这些API文档工具。其中一些可能有陡峭的学习曲线,但一旦你习惯了它们,它们将使你的API易于使用。



有关这些工具的注意事项,你可以把口红放在猪身上,但它仍然是一头猪。这意味着,如果您不向这些API提供内容以使其更清晰,那么您只需交换一份不清楚/不适合开发人员的API文档,以获取另一个不清楚/不适合开发人员的API文档。



Swagger - 世界上最受欢迎的API框架。 [ ^ ]



API蓝图| API蓝图 [ ^ ]



GitHub - lord / slate:API的漂亮静态文档 [ ^ ]
If i am understanding your question correctly, your issue is that you've got API documentation that is hard to read/understand and is lacking in detail but you want to convert it into a more user friendly format that helps developers help themselves?

I would suggest looking at some of these API documentation tools. Some of them may have steep learning curves, but once you get use to them they will make your API's easy to use.

One thing to note about these tools, you can put lipstick on a pig but it is still a pig. Meaning, if you don't provide the content to these API's to make them more clear, your just trading one unclear/not developer friendly API document for another unclear/not developer friendly API document.

Swagger – The World's Most Popular Framework for APIs.[^]

API Blueprint | API Blueprint[^]

GitHub - lord/slate: Beautiful static documentation for your API[^]


这篇关于如何将API文档转换为窗口小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆