jhipster - JHipster OpenApi 总是返回 501
问题描述
我在 api.yml 上注册的每个服务都有一个 501。我正在使用 JHipster 7.3.0、Open API 3.0.1、Java 11 和 Vue 2.6.14,一切都配置了 JHipster 默认设置。我正在尝试创建 Petstore 示例,我复制了 api.yml,生成代码并实现了一些服务。
奇怪的是,当我尝试从前端应用程序使用服务时,它返回 501,但如果我在 api.yml 中注释定义,它工作正常。
...
/pet/findByTags:
get:
tags:
- pet
summary: Finds Pets by tags
description: >-
Multiple tags can be provided with comma separated strings. Use tag1,
tag2, tag3 for testing.
operationId: findPetsByTags
parameters:
- name: tags
in: query
description: Tags to filter by
required: false
explode: true
schema:
type: array
items:
type: string
responses:
'200':
description: successful operation
content:
application/xml:
schema:
type: array
items:
$ref: '#/components/schemas/Pet'
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Pet'
'400':
description: Invalid tag value
security:
- petstore_auth:
- 'write:pets'
- 'read:pets'
...
另一件事是,在某种情况下,服务总是返回 501,但如果我从邮递员那里使用它,它就可以正常工作。
/categories:
get:
tags:
- pet
- category
summary: Get all the categories
description: >-
Get All the Categories.
operationId: getCategories
responses:
'200':
description: Category List
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Category'
security:
- petstore_auth:
- 'write:pets'
- 'read:pets'
解决方案
推荐阅读
- c# - WebClient.DownloadFile 和正确的 C# 中的 url 操作已超时
- angular - 像 PLATFORM_ID 这样的 Angular 核心提供程序
- python - 使用 SQLAlchemy 和 PostgreSQL 查询两个表
- python - 如何将kivy中的文本输入保存到变量中
- ios - 如何禁用按钮而不是tableview单元格中的当前?
- flutter - 在 Android 中更改 Flutter 的表情符号字体
- python - 烧瓶 url_for - 传递参数
- c# - 在 .NET Framework 4.8 中使用 Roslyn 执行的脚本(~.csx)在完成后是否会被卸载
- reactjs - 为什么用户注册公式包含单选按钮时无法提交?
- mysql - 尝试创建事件时出现一些语法错误