我想使用aglio/api blueprint为我们的新API创建一个很好的文档。
JSON可能非常大(有很多可选的值),所以我想在正文中给出一个适当的用例,但也要使用json模式的数据结构。但是,只要模式与正文完全匹配,生成的HTML就会向我抛出" Hello,World!“,因为我没有填写示例数据-但由于我在正文中有一个完整且有效的示例,因此我不希望aglio创建Hello World输出。
作为参考,这就是我期望在产生的htmls主体中出现的内容:
{
"a": "i want this to appear",
"b": "in my aglio",
"c": "html file"
}这是实际出现的情况:
{
"a": "Hello, world!",
"b": "Hello, world!",
"c": "Hello, world!",
"d": "Hello, world!"
}这是原始的api蓝图:
FORMAT: 1A
# JSON Schema
# Test [/post/something]
## A Test [POST]
+ Request (application/json)
+ Attributes (SomeObject)
+ Body
{
"a": "i want this to appear",
"b": "in my aglio",
"c": "html file"
}
+ Response 200
# Data Structures
## SomeObject (object)
+ a (string) - A
+ b (string) - B
+ c (string) - C
+ d (string, optional) - I'm optional, yet don't want to appear in the html, only the schema所以,首先:这是一种有效的做事方式吗?你能推荐一种不同的方法吗?这是不是aglio中的一个bug,因为在养蜂人中它的工作方式与我的预期一致?谢谢!
https://stackoverflow.com/questions/38464947
复制相似问题