首页 \ 问答 \ 通过spring-rest-docs构建swagger2规范(Build swagger2 specs via spring-rest-docs)

通过spring-rest-docs构建swagger2规范(Build swagger2 specs via spring-rest-docs)

我喜欢TDD方法,用spring-rest-docs记录你的restful api。 但是,我喜欢swagger规范启用的“API Playground”功能。 我希望有一种方法可以充分利用这两个世界。

有没有办法从Spring rest docs构建swagger2规范? 可能是通过构建自定义请求/响应预处理器。

你有什么想法或建议吗?


I like the TDD approach to documenting your restful api with spring-rest-docs. However, I love "API Playground" feature enabled by swagger specification. I wish there was a way to get best of both worlds.

Is there a way to build swagger2 specs from spring rest docs? may be via building custom request/response preprocessors.

Do you have any thoughts or recommendations?


原文:https://stackoverflow.com/questions/36090032
更新时间:2022-03-30 21:03

最满意答案

apt-get安装已从分发库中编译的软件包。 它还负责安装所有依赖项。 包维护者已经编译了包并确保满足它的依赖性(其他包及其版本)。

这种方法非常方便,并且应该首选。 源安装的唯一主要优点 - 或支持论证 - 是您获得更新的包。

如果您希望从分发版本中尚未提供的功能中受益,可能需要从源代码进行编译。 在编译器的情况下,也可能是较新版本产生比更早版本更“更好”的二进制文件。

选择自己编译软件的另一个原因可能是您想要影响构建过程,例如不同的编译器设置或具有较少依赖性的不同配置。 然而,这种情况非常罕见 - 在大多数情况下,这不值得麻烦。

此外,正如您自己所经历的那样,安装预编译的软件包只需几分钟(甚至几秒钟),而编译需要一些时间,具体取决于要编译的软件和硬件。

最重要的是,除非你有充分的理由,否则请使用发行版的软件包。


apt-get installs already compiled packages from the repository of the distribution. It also takes care of installing all dependencies. The package maintainer has compiled the package and makes sure that it dependencies (other packages and their versions) are met.

This approach is very convenient and should, by all means, be preferred. The only major advantage – or argument in favour – of a source installation is that you get more recent packages.

Compiling from source may be necessary when you want to benefit from features that are not yet available in the distribution’s version. In the case of the compiler it may also be that a newer version produces “better” binaries than an earlier version.

Another reason for choosing to compile software yourself may be that you want to influence the building process, e.g. different compiler settings or a different configuration with less dependencies. However, such cases are quite rare – in most case, it isn’t worth the trouble.

Also, as you’ve experienced yourself, installing a pre-compiled package takes only a few minutes (or even just seconds), while compiling will take some time depending on the software to compile and your hardware.

Bottom line, unless you have a good reason, use the distribution’s package(s).

相关问答

更多
  • OpenCV 2.2以后版本需要使用Cmake生成makefile文件,因此需要先安装cmake。 ubuntu下安装cmake比较简单, apt-get install cmake apt-get install libgtk2.0-dev(下面两步安装编译必须的库) apt-get install pkg-config 然后你们下载openc-2.4.3 然后 解压 然后cmake-gui 进入了 ui配置界面 在路劲那里配置好你的opencv位置 和 安装路径 然后点 configure 然后选中 u ...
  • 这看起来像教程中的一个错误 - toy.cpp的代码toy.cpp是独立的,但现在依赖于LLVM头(这是最近的一次更改 )。 您可以使用第3章中提供的命令来构建,即: clang++ -g -O3 toy.cpp `llvm-config --cxxflags --ldflags --system-libs --libs core` -o toy That looks like a bug in the tutorial -- the code in toy.cpp used to be self-con ...
  • 我真的不会说德语,但是如果你有破包,请参考我关于破包的回答问题。 希望能帮助到你! I don't really speak German, but if you have broken packages, try referring to my answered question about broken packages. Hope it helps!
  • 我会预期,您将不时希望能够以詹金斯身份登录以执行其他任务,因此我将解决更普遍的问题。 最后包括对您的问题的严格回答。 更改詹金斯的密码而不知道 从任何具有sudo权限的帐户,您可以将jenkins的密码重置为您选择的: sudo passwd jenkins 您可能会首先询问您自己的密码,以便使用sudo。 然后,系统将提示您输入新密码以设置jenkins,最后确认该新密码。 如果您的sudo权限用户称为joe,则会话可能如下所示: joe $ sudo passwd jenkins [sudo] pas ...
  • 您指向不受支持的/不再支持的Ubuntu发行版。 使用任一 16.04 LTS发布,或者 17.10当前版本 因为16.10和17.04已经被关闭了(在后者的情况下有点烦人)。 FWIW我倾向于在几台机器上每六个月升级一次,而且通常只能在游泳中使用。 You are pointing at an unsupported / no longer supported Ubuntu release. Use either the 16.04 LTS release, or the 17.10 current re ...
  • owncloud是一个包含很多不同内容的大包。 你应该有: /etc/apache2/sites-available的apache配置文件(可能名为owncloud.conf ) 数据库中的表。 这取决于您第一次配置owncloud的方式。 您自己的配置在该表中。 owncloud本身的文件。 如果你remove它可能它们已经消失了。 对于数据库: 如果你有MySQL,那么 sudo mysql -u root -p 连接到数据库,然后做 SHOW DATABASES; 检查您是否有一个名为ownclo ...
  • 你可以使用这个: apt-cyg 就命令行参数而言,它就像apt-get一样,但你将使用apt-cyg 。 You can use this : apt-cyg It works just like apt-get in terms of command line arguments, but you will be using apt-cyg instead.
  • 常见问题解答说明如下: 目前,CLion支持GCC和Clang编译器,并由这两个编程引导,以获取库和头文件路径。 在下一个版本中,我们计划扩展CLion中可用的编译器列表。 要更改编译器,请转到CMake工具窗口中的Cache选项卡,并设置编译器到CMAKE_CXX_COMPILER变量的路径。 然后按Enter键并单击“应用更改并重新加载”按钮 The FAQ states the following: At present CLion supports GCC and Clang compilers a ...
  • apt-get安装已从分发库中编译的软件包。 它还负责安装所有依赖项。 包维护者已经编译了包并确保满足它的依赖性(其他包及其版本)。 这种方法非常方便,并且应该首选。 源安装的唯一主要优点 - 或支持论证 - 是您获得更新的包。 如果您希望从分发版本中尚未提供的功能中受益,可能需要从源代码进行编译。 在编译器的情况下,也可能是较新版本产生比更早版本更“更好”的二进制文件。 选择自己编译软件的另一个原因可能是您想要影响构建过程,例如不同的编译器设置或具有较少依赖性的不同配置。 然而,这种情况非常罕见 - 在大 ...
  • 简短的回答是来自服务器的apt-get下载包,sources.list包含并执行安装脚本。 答案很长,您可以从http://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html学习debian开发人员文档。 Short answer is apt-get download package from server which sources.list includes and execute install scr ...

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)