定制 vortechron/laravel-data-openapi-generator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

vortechron/laravel-data-openapi-generator

Composer 安装命令:

composer require vortechron/laravel-data-openapi-generator

包简介

Generate OpenAPI specification from Laravel routes and Laravel Data objects.

README 文档

README

Generate OpenAPI specification from Laravel routes and Laravel Data objects

Install

Add composer repository

In composer.json add this repository:

    "repositories": [
        {
            "type": "github",
            "url": "https://github.com/vortechron/laravel-data-openapi-generator"
        }
    ],

Install

composer require xolvio/laravel-data-openapi-generator

Optional

Version

Add a app.version config in app.php to set the version in the openapi specification:

    'version' => env('APP_VERSION', '1.0.0'),

Vite PWA config

If using vite-plugin-pwa, make sure to exclude '/api/' routes from the serviceworker using this config:

VitePWA({
	workbox: {
		navigateFallbackDenylist: [new RegExp("/api/.+")],
	},
});

Vue page

<route lang="json">
{
	"meta": {
		"public": true
	}
}
</route>

<template>
	<iframe
		:src="url"
		style="width: calc(100vw - 40px);height: calc(100vh - 80px); border: none;"
	/>
</template>

<script lang="ts" setup>
const url = `${import.meta.env.VITE_APP_URL}/api/openapi`;
</script>

Usage

Config

php artisan vendor:publish --tag=openapi-generator-config

Generate

php artisan openapi:generate

View

Swagger available at APP_URL/api/openapi

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 21
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-27