All Projects → caixw → Apidoc

caixw / Apidoc

Licence: mit
RESTful API 文档生成工具,支持 Go、Java、Swift、JavaScript、Rust、PHP、Python、Typescript、Kotlin 和 Ruby 等大部分语言。

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Apidoc

Generator Http Fake Backend
Yeoman generator for building a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 49 (-93.76%)
Mutual labels:  api, rest-api, rest, restful-api, restful
Ngx Restangular
Restangular for Angular 2 and higher versions
Stars: ✭ 787 (+0.25%)
Mutual labels:  api, rest-api, rest, restful-api, restful
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (-76.94%)
Mutual labels:  api, rest-api, rest, restful-api, restful
Http Fake Backend
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 253 (-67.77%)
Mutual labels:  api, rest-api, rest, restful-api, restful
Api Strategy
Equinor API Strategy
Stars: ✭ 56 (-92.87%)
Mutual labels:  api, rest-api, rest, restful-api, restful
Node Express Mongoose Passport Jwt Rest Api Auth
Node, express, mongoose, passport and JWT REST API authentication example
Stars: ✭ 146 (-81.4%)
Mutual labels:  api, rest-api, rest, restful-api, restful
Http restful api
整理HTTP后台端的RESTful API方面的知识
Stars: ✭ 94 (-88.03%)
Mutual labels:  api, rest-api, rest, restful
Api Restful Con Laravel Guia Definitiva
Repositorio para el código base del curso "API RESTful con Laravel - Guía Definitiva"
Stars: ✭ 95 (-87.9%)
Mutual labels:  api, rest-api, restful-api, restful
Rest Api Design Guide
NBB's REST-ish API Design Guide
Stars: ✭ 643 (-18.09%)
Mutual labels:  rest-api, rest, restful-api, restful
Node Express Postgresql Sequelize
Node.js, Express.js, Sequelize.js and PostgreSQL RESTful API
Stars: ✭ 148 (-81.15%)
Mutual labels:  api, rest, restful-api, restful
Open Rest
Standard rest server, Base on restify and sequelize
Stars: ✭ 136 (-82.68%)
Mutual labels:  api, rest-api, rest, restful-api
Appkernel
API development made easy: a smart Python 3 API framework
Stars: ✭ 152 (-80.64%)
Mutual labels:  api, rest-api, rest, restful-api
Openapi Generator
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
Stars: ✭ 10,634 (+1254.65%)
Mutual labels:  api, rest-api, rest, restful-api
Restful Api Guidelines
A model set of guidelines for RESTful APIs and Events, created by Zalando
Stars: ✭ 1,397 (+77.96%)
Mutual labels:  api, rest-api, restful-api, restful
Proteus
Lean, mean, and incredibly fast JVM framework for web and microservice development.
Stars: ✭ 178 (-77.32%)
Mutual labels:  api, rest-api, rest, restful-api
Restful Api Design References
RESTful API 设计参考文献列表,可帮助你更加彻底的了解REST风格的接口设计。
Stars: ✭ 4,830 (+515.29%)
Mutual labels:  rest-api, rest, restful-api, restful
Awesome Http Benchmark
HTTP(S) benchmark tools, testing/debugging, & restAPI (RESTful)
Stars: ✭ 2,236 (+184.84%)
Mutual labels:  rest-api, restful-api, restful, tools
Blogbackendproject
Backend code for my blogs, develop with Django Rest framework.
Stars: ✭ 204 (-74.01%)
Mutual labels:  rest-api, rest, restful-api, restful
Restful Api With Laravel Definitive Guide
Repository with the base code for the course "RESTful API with Laravel - Definitive-Guide"
Stars: ✭ 156 (-80.13%)
Mutual labels:  api, rest-api, restful-api, restful
Clevergo
👅 CleverGo is a lightweight, feature rich and high performance HTTP router for Go.
Stars: ✭ 246 (-68.66%)
Mutual labels:  api, rest-api, restful-api, restful

apidoc

Test Status Latest Release Go Report Card codecov PkgGoDev license

apidoc 是一个简单的 RESTful API 文档生成工具,它从代码注释中提取特定格式的内容,生成文档。

目前支持支持以下语言:C#、C/C++、D、Dart、Erlang、Go、Groovy、Java、JavaScript、Julia、Kotlin、Lisp/Clojure、Lua、Nim、Pascal/Delphi、Perl、PHP、Python、Ruby、Rust、Scala、Swift、Typescript 和 Zig。

具体文档可参考:https://apidoc.tools

/**
 * <api method="GET" summary="获取所有的用户信息">
 *     <path path="/users">
 *         <query name="page" type="number" default="0" summary="显示第几页的内容" />
 *         <query name="size" type="number" default="20" summary="每页显示的数量" />
 *     </path>
 *     <tag>user</tag>
 *     <server>users</server>
 *     <response status="200" type="object" mimetype="application/json">
 *         <param name="count" type="int" optional="false" summary="符合条件的所有用户数量" />
 *         <param name="users" type="object" array="true" summary="用户列表">
 *             <param name="id" type="int" summary="唯一 ID" />
 *             <param name="name" type="string" summary="姓名" />
 *         </param>
 *         <example mimetype="application/json">
 *         <![CDATA[
 *         {
 *             "count": 500,
 *             "users": [
 *                 {"id":1, "name": "管理员2"},
 *                 {"id":2, "name": "管理员2"}
 *             ],
 *         }
 *         ]]>
 *         </example>
 *     </response>
 *     <response status="500" mimetype="application/json" type="object">
 *         <param name="code" type="int" summary="错误代码" />
 *         <param name="msg" type="string" summary="错误内容" />
 *     </response>
 * </api>
 */
func login(w http.ResponseWriter, r *http.Request) {
    // TODO
}

使用

https://github.com/caixw/apidoc/releases 提供了部分主流系统下的可用二进制。如果你使用的系统不在此列,则需要手动下载编译。

支持多种本地化语言,默认情况下会根据当前系统所使用的语言进行调整。也可以通过设置环境变更 LANG 指定一个本地化信息。*nix 系统也可以使用以下命令:

LANG=lang apidoc # lang 设置为你需要的语言 ID,比如 zh-hans 等。

具体的安装和使用细节可参考 https://apidoc.tools/#usage

集成

若需要将 apidoc 当作包集成到其它 Go 程序中,可参考以下代码:

import (
    "golang.org/x/text/language"

    "github.com/caixw/apidoc/v7"
    "github.com/caixw/apidoc/v7/core"
    "github.com/caixw/apidoc/v7/build"
)

// 初始本地化内容
apidoc.SetLocale(language.MustParse("zh-Hans"))

// 可以自定义实现具体的错误处理方式
h := core.NewHandler(...)

output := &build.Output{...}
inputs := []*build.Input{...}

apidoc.Build(h, output, inputs...)

具体可查看文档:https://pkg.go.dev/github.com/caixw/apidoc/v7

参与开发

请阅读 CONTRIBUTING.md 文件的相关内容。

版权

本项目源码采用 MIT 开源授权许可证,完整的授权说明可在 LICENSE 文件中找到。

文档内容的版权由各个文档各自表述。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].