当前位置: 首页 > 知识库问答 >
问题:

Openapi YAML错误,无法生成客户端存根

徐俊人
2023-03-14

作为第一步,我使用了Quarkus Openapi指南:https://Quarkus.io/guides/openapi-swaggerui,但是在运行未修改的示例并通过http://localhost:8080/Openapi检索Openapi YAML-Data之后,我注意到生成的数据是错误的,并且Openapi生成器由于stackoverflow错误而无法生成客户端。

问题: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'

这是一个已知的问题,还是我这边有些误解。有办法解决这个问题吗?

多谢!

共有1个答案

姜经武
2023-03-14

它绝对不应该生成一个自引用定义!你能在这里提出一个问题吗:

https://github.com/smallrye/smallrye-open-api/issues

该库是Quarkus支持该特性背后的实现。如果你能包括一个复制项目,这将是非常有帮助的。或者至少提供一些关于fruitsetfruitjava类的信息。

 类似资料:
  • 嗯,首先,对不起我的英语不好。 “enderecodao.java”: 和ENDERECO的WebService“servicoEnderEco.java”:

  • 我需要在我的项目中使用一个web服务。我使用NetBeans所以我右键单击我的项目并尝试添加一个新的“Web服务客户端”。上次我检查时,这是创建web服务客户机的方法。但它导致一个AssertionError,它说: java.lang.AssertionError:org.xml.sax.SAXParseException;systemid:jar:file:/path/to/glassfish

  • 我们试图对cadence设置进行基准测试(目前在2个EC2实例上运行:m5a.xlarge ),发现了许多cadence客户端错误: cadence_service:cadence_matching,操作:历史记录重新记录活动任务已启动

  • 我的服务器上再次收到错误。 { “错误”: “invalid_client” } 我已经编码到base64并将域列入了白名单,但仍然得到相同的错误。我会感激任何帮助,这让我发疯了,哈哈。

  • 代码如下 我已经创建了一个DynamoDB表我的主键是,它是字符串。 在DynamoDB中,的表值是我需要更新为David。上面是代码。为什么错误会抛出元模式 完整错误如下所示 “errorMessage”:“调用UpdateItem操作时发生错误(ValidationException):更新表达式中提供的文档路径对于更新无效”,“errorType”:“ClientError”, 在代码下面尝

  • 本文向大家介绍vue生成token保存在客户端localStorage中的方法,包括了vue生成token保存在客户端localStorage中的方法的使用技巧和注意事项,需要的朋友参考一下 前面我们已经了解了可以通过localStorage在客户端(浏览器)保存数据。 我们后端有这样一个接口: http://localhost/yiiserver/web/index.php/token?clie