swagger - 如何在 swagger ui 中指定参数对象
问题描述
我在 swagger 编辑器中运行了一个 yml 文件,尽管下面发布的代码中设置的参数是正确的,但我输入的浮点经度和纬度值不被 swagger ui 接受
请让我知道如何解决此错误
代码:
paths:
/getDistance/{startAndEndCoords}:
get:
tags:
- get distance
- get distance in kilometers
summary: get the distance between two GPS coordinates in Kilometers.
description: >
startAndEndCoords represents the start and end GPS coordinates in the following order longitude and latitude respectively. Passing the start and end
GPS cootdinates in the URL will result in invoking and communicating with OpenRouteService. The latter service will send a response in a form of json
file.The JSON file will be fetched for the distance. The distance fetched, is the distance between the GPS coordinates entered and it is in meters, however
they are displayed to the users in Kilometers.
operationId: getDistance
parameters:
- name: startAndEndCoords
in: path
description: Start and end GPS coordinates as comma separated values in terms of longitude and latitude respectively. For example
12.497366,41.922782,-3.606997572,40.47416477
required: true
schema:
type: number
format: float
allowEmptyValue: false
responses:
'200':
description: Distance fetched successfully.
解决方案
推荐阅读
- node.js - 执行查询交易时仅选择背书节点 - Node SDK
- twig - 如何检查动态变量是否存在?
- python - 在 Python Paramiko 中的 SSH 服务器上的辅助 shell/命令中执行(子)命令
- reactjs - 在 TS 中解构对象
- blazor-server-side - Blazor 路由对象参数
- apache-spark - 如何修复'java.lang.NoSuchMethodError: scala.collection.immutable.$colon$colon.hd$1()Ljava/lang/Object'
- acumatica - Acumatica 更改报告菜单的可见性
- java - IdleStateHandler AllIdleTimeoutTask 在指定的超时之前被触发
- android - 文档与android中的实际类“InstrumentationRegistry”之间的不相关性
- c# - 如何在 NET Core 中使用 LINQ 检查用户是否已提供乘车服务