openapi接口文档解析支持

This commit is contained in:
暮光:城中城
2021-12-28 23:58:43 +08:00
parent bc7ae4fc67
commit 74b1b417ad
34 changed files with 196 additions and 3150 deletions

View File

@@ -42,8 +42,8 @@
</template>
</template>
<template #expandedRowRender="{ record }">
<template v-if="record.schemas">
<a-table :dataSource="record.schemas" :columns="responseParamListColumns" size="small" :pagination="false">
<template v-if="record.childrens">
<a-table :dataSource="record.childrens" :columns="responseMediaTypeColumns" size="small" :pagination="false">
<template #bodyCell="{ column, text, record }">
<template v-if="column.dataIndex === 'type'">
{{text}}
@@ -51,9 +51,23 @@
<template v-if="record.format">({{record.format}})</template>
</template>
</template>
<template #expandedRowRender="{ record }">
<template v-if="record.schemas">
<a-table :dataSource="record.schemas" :columns="responseParamListColumns" size="small" :pagination="false">
<template #bodyCell="{ column, text, record }">
<template v-if="column.dataIndex === 'type'">
{{text}}
<template v-if="record.subType">[{{record.subType}}]</template>
<template v-if="record.format">({{record.format}})</template>
</template>
</template>
</a-table>
</template>
<div v-else style="text-align: center;padding: 10px 0;">无结果说明</div>
</template>
</a-table>
</template>
<div v-else style="text-align: center;padding: 10px 0;">参数说明</div>
<div v-else style="text-align: center;padding: 10px 0;">结果说明</div>
</template>
</a-table>
</a-form-item>
@@ -98,6 +112,9 @@
{title: '类型', dataIndex: 'type', width: 250},
{title: '说明', dataIndex: 'desc'},
],
responseMediaTypeColumns: [
{title: '媒体类型', dataIndex: 'mediaType'},
],
responseParamListColumns: [
{title: '参数名', dataIndex: 'name', width: 250},
{title: '类型', dataIndex: 'type', width: 250},