API文档中的自定义附加信息 [英] custom additional information in API documentation

查看:329
本文介绍了API文档中的自定义附加信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经阅读这里关于web API帮助页面的其他信息。数据注释实际上提供了文档的附加信息。但是我想知道,无论如何提供额外的信息,没有数据注释?



如果是,那么如何?



如果不是,那么有没有办法用数据注释覆盖附加信息,例如

  [必需] 

显示需要写入其他信息,但如果要显示此字段是必需的或类似的内容? / p>

谢谢



编辑看到我想更新没有数据的附加信息

解决方案

如果你想给定制附加信息(使用数据注释),那么@Pedro G. Dias的答案是你的解决方案,但如果你想提供额外的信息,而不使用数据注释,那么我恐怕这是不可能的,或者你必须使用一些替代程序这样做由@DynamicVariable在你的问题。



PS。我已经调试了文档项目来检查,我发现添加信息实际上是由数据注释提供的。


I've read here about additional information of web API help page. The data annotation actually provides the additional information for documentation. But I want to know that is there anyway to provide additional information without data annotations?

If yes then how?

If not then is there anyway to override the additional information with data annotations for instance the

[Required]

shows Required written in additional information but what if I want to show "This field is required" or something like that?

Thanks

EDIT see in picture I want to update that additional information without data annotation if possible.

解决方案

If you want to give custom additional information(using data annotation) then @Pedro G. Dias's answer is your solution but if you want to give additional information without using data annotation then I am afraid that it is not possible OR you have to use some alternative procedure to do so as commented by @DynamicVariable on your question.

PS. I've debugged documentation project to check and I found that addition information is actually provided by data annotations.

这篇关于API文档中的自定义附加信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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