简体   繁体   English

Java或JavaScript库可从Swagger,RAML或API蓝图生成HTML

[英]Java or JavaScript library to generate HTML from Swagger, RAML or API Blueprint

Problem: 问题:

I am searching for a library in Java or JavaScript (or maybe Scala) which is able to generate an HTML representation of Swagger, RAML or API Blueprint input. 我正在搜索Java或JavaScript(或Scala)库,该库能够生成Swagger,RAML或API Blueprint输入的HTML表示形式。

Background: 背景:

The idea is to use it as a part of a (Play Framework) web app serving as an API catalog. 想法是将其用作(Play Framework)Web应用程序的一部分,用作API目录。 API specifications would be added by users of the API catalog and resulting HTML representations would be generated/displayed. API规范的用户将添加API规范,并且将生成/显示结果HTML表示。

It would give extra value if a API specification stub also is possible to create using a Java API. 如果还可以使用Java API创建API规范存根,那么它将提供额外的价值。 The API catalog web app has a data model which I would like to use when generating the API stubs. API目录Web应用程序具有一个数据模型,我想在生成API存根时使用它。

Furthermore, it would give extra value if the same (or related another) library provided a nice HTML editor of the API specification language (Swagger, RAML, API Blueprint etc) supporting the user while editing. 此外,如果同一个(或相关的另一个)库提供了API规范语言(Swagger,RAML,API Blueprint等)的不错的HTML编辑器在编辑时支持用户,那么它将提供额外的价值。

Swagger offers a set of tools to do it. Swagger提供了一组工具来做到这一点。

Swagger-Core will enable you to produce Swagger documentation from your Play code. Swagger-Core将使您能够从Play代码生成Swagger文档。 This is done at runtime and will change as your application changes. 这是在运行时完成的,并且会随着应用程序的更改而更改。

Swagger-UI will read such docs and display them in an HTML format. Swagger-UI将阅读此类文档并以HTML格式显示。 It also allows you to execute the operations and has integration with security mechanisms if needed. 它还允许您执行操作,并在需要时与安全机制集成。 The UI can be customized to have the look-and-feel of your application (like many have done so far). 可以对UI进行自定义,以具有应用程序的外观(就像到目前为止所做的一样)。

Swagger-Editor allows for direct editing of Swagger documentation with interactive side-by-side view of the docs in an HTML format. Swagger-Editor可以直接编辑Swagger文档,并具有HTML格式的交互式文档并排视图。

Swagger-Codegen can take such a documentation and generate both client and server code. Swagger-Codegen可以获取此类文档,并生成客户端和服务器代码。 You can customize the templates to suit your needs. 您可以自定义模板以适合您的需求。

There are several tools for for generating HTML from an API Blueprint, one of which is in Coffeescript and is called Aglio. 有多种用于从API蓝图生成HTML的工具,其中之一在Coffeescript中,称为Aglio。 You can see all of the tools here: 您可以在此处查看所有工具:

http://apiblueprint.org/ http://apiblueprint.org/

Also, Apiary is a service that uses API Blueprint and can be used for editing and hosting generated documentation, hooking up with Github to auto-generate from commits, providing some mocking APIs and some other cool stuff for teams and enterprises. 此外, Apiary是使用API​​蓝图的服务,可用于编辑和托管生成的文档,与Github挂钩以从提交中自动生成,为团队和企业提供一些模拟API和其他一些不错的东西。 You could check it out if you're wanting a solid service for your API documentation. 如果您想为API文档提供可靠的服务,则可以查看。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM