Rest 在OpenAPI中,对于相同的路由和操作是否可能有两个不同的规范?
是否可以在OpenAPI中为相同的路由和操作创建两个规范?比如说Rest 在OpenAPI中,对于相同的路由和操作是否可能有两个不同的规范?,rest,openapi,Rest,Openapi,是否可以在OpenAPI中为相同的路由和操作创建两个规范?比如说 paths: /places/: get: summary: Find place by external ID. operationId: getPlaceByExternalId parameters: - name: external_id in: query required: true schema
paths:
/places/:
get:
summary: Find place by external ID.
operationId: getPlaceByExternalId
parameters:
- name: external_id
in: query
required: true
schema:
type: integer
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Place'
get:
summary: Find places by coordinates.
operationId: findPlace
parameters:
- name: lat
in: query
required: true
schema:
type: number
- name: lon
in: query
required: true
schema:
type: number
responses:
'200':
description: Successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Place'
此规范无效,但描述了现有API。使其有效的最佳方法是什么