Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 查询中的必需参数未在UI中标记_Java_Swagger_Swagger Ui - Fatal编程技术网

Java 查询中的必需参数未在UI中标记

Java 查询中的必需参数未在UI中标记,java,swagger,swagger-ui,Java,Swagger,Swagger Ui,我已在yaml文件参数表中标记: parameters: - name: someID in: query description: The some ID required: true schema: type: uuid 在生成的java类中,字段被标记为required,这很好,但在Swagger UI上,不幸的是没有。这是有问题的,因为我想在请求失败之前通知用户需要这个文件。在OpenAPI 2

我已在yaml文件参数表中标记:

     parameters:
     - name: someID
       in: query
       description: The some ID
       required: true
       schema:
        type: uuid
在生成的java类中,字段被标记为required,这很好,但在Swagger UI上,不幸的是没有。这是有问题的,因为我想在请求失败之前通知用户需要这个文件。

在OpenAPI 2.0(
swagger:'2.0'
)中,查询参数不使用
schema
,而是直接使用
type
关键字。请注意,您需要的是
类型:string
+
格式:uuid

参数:
-姓名:someID
in:查询
description:someid
必填项:true
类型:字符串
格式:uuid
Swagger UI通过在参数名称旁边显示红色的
*required
注释来指示所需参数:


1)这是
openapi:3.0.0
还是
招摇过市:“2.0”
?2) OpenAPI/Swagger中没有
type:uuid
,你是说
type:string
+
format:uuid
?3) 您使用的是-2.x还是3.x?我相信两者都是通过使用
*
.swagger:2.0在哪里添加*?在名字的末尾?架构:类型:字符串格式:uuid