【发布时间】:2020-03-27 16:49:23
【问题描述】:
我将 Quarkus 评估为后端,由 Angular 前端访问。 我想使用 Quarkus 通过http://localhost:8080/openapi 提供的openapi 数据, 并通过 openapi-generator 工具生成 typescript-angular 客户端存根。
我使用 Quarkus Openapi 指南作为第一步:https://quarkus.io/guides/openapi-swaggerui 但是在运行未修改的示例并通过 http://localhost:8080/openapi 检索 Openapi YAML 数据后,我注意到生成的数据是错误的,并且由于 stackoverflow 错误,openapi 生成器无法生成客户端。
问题:SetFruit-Definition(最后一行)的 Openapi-data 中的自引用:
openapi: 3.0.1
info:
title: Generated API
version: "1.0"
paths:
/fruits:
get:
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SetFruit'
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Fruit'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SetFruit'
delete:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Fruit'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SetFruit'
components:
schemas:
Fruit:
type: object
properties:
description:
type: string
name:
type: string
SetFruit:
$ref: '#/components/schemas/SetFruit'
这是一个已知问题,还是我这边有一些误解。 有没有办法解决这个问题?
非常感谢!
【问题讨论】:
-
您能否提出问题github.com/quarkusio/quarkus/issues 与重现该问题的项目?然后团队可以调查问题可能是什么