承接 code-orange/jot 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

code-orange/jot

Composer 安装命令:

composer require code-orange/jot

包简介

Laravel package that generates RESTful API documentation in Markdown based on PHPDoc.

README 文档

README

Jot is a Laravel package that generates RESTful API documentation in Markdown based on PHPDoc.

Installation

To install jot with composer:

composer require code-orange/jot

Laravel 5.5+

If you're using Laravel 5.5 or above, the package will automatically register the Jot provider.

Laravel 5.4

Add CodeOrange\Jot\JotServiceProvider::class to the providers array in config/app.php.

Configuration

You can use php artisan vendor:publish to publish the jot configuration to your application:

php artisan vendor:publish --provider=CodeOrange\\Jot\\JotServiceProvider

Then, update config/jot.php.

Usage

Generating documentation

First, document your controller actions with PHPDoc.

class MyController {
	/**
	 * Returns a value
	 *
	 * This method returns a cool value.
	 *
	 * @param mixed $b Some value
	 * @return JsonResponse {
	 *                          "a": 1,
	 *                          "b": "Example"
	 *                      }
	 */
	public function myAction(Request $r) {
		return response()->json([
			'a' => 1,
			'b' => $r->get('b')
		]);
	}
}

Then, run php artisan jot:generate. Markdown documenting your API will be printed to your console.

## Returns a value

This method returns a cool value.

`GET /example`

### Parameters

| Name | Located in | Description | Type |
| ---- | ---------- | ----------- | ---- |
|b|request|Some value|mixed|
|account|path|||

```json
{
    "a": 1,
    "b": "Example"
}
```

You can then add this Markdown to whatever you use to publish your docs. That can just be a Markdown file on GitHub, a wiki, or a self-hosted documentation site.

The Markdown is compatible with lord/slate, which is what we're using at Odyssey to publish our documentation.

Checking documentation coverage

Jot can also check if all of your public API methods are properly documented, for instance as part of your CI test pipeline.

php artisan jot:coverage

will exit with an error status code if there is a method in your API that is not documented.

Optionally, you can use --return to force all methods to have a documented return type/example.

Motivation

This project is heavily inspired by f2m2/apidocs. While that project generates excellent documentation, I didn't like the idea of a Laravel app hosting its own documentation (something that can be done statically and that probably has much different access patterns).

Jot allows you to separate generation and publication of your API docs.

Read more about building Jot in this blogpost.

code-orange/jot 适用场景与选型建议

code-orange/jot 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.31k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2017 年 07 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「documentation」 「phpdoc」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 code-orange/jot 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 code-orange/jot 我们能提供哪些服务?
定制开发 / 二次开发

基于 code-orange/jot 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 9.31k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 3
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2017-07-29