使用Swagger记录API

时间:2015-04-20 16:49:09

标签: scala playframework swagger

我是Swagger的新人。我有一个API,我想用Swagger基于模型而不是注释来记录它。请提供一些指导我该怎么办?提前致谢!我需要文学,例子,教程等。

1 个答案:

答案 0 :(得分:1)

Swagger是创建REST API文档和API沙箱的最简单方法,您只需遵循swagger API定义的一些注释规则。

你必须首先学习以下内容 -

  1. 基本REST API概念
  2. REST API with Play。
  3. 查看Swagger注释。
  4. 您可以在http://petstore.swagger.io/

    看到该演示

    要了解流程,请参阅以下文件

    https://github.com/swagger-api/swagger-play-sample-app/blob/master/app/controllers/PetController.scala

    https://github.com/swagger-api/swagger-play-sample-app/blob/master/conf/routes