Add tests for duplicated operationId (#20070)

* add tests for duplicated operation id

* add spec file
This commit is contained in:
William Cheng 2024-11-09 16:38:20 +08:00 committed by GitHub
parent b34df341a4
commit 1bda458882
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1138 additions and 952 deletions

View File

@ -0,0 +1,58 @@
openapi: 3.0.0
servers:
- url: 'http://petstore.swagger.io/v2'
info:
description: A sample spec to test duplicated operationId
version: 1.0.0
title: OpenAPI Petstore
license:
name: Apache-2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
paths:
'/pet/{petId}':
get:
tags:
- pet
summary: Find pet by ID
description: Returns a single pet
operationId: getObject
parameters:
- name: petId
in: path
description: ID of pet to return
required: true
schema:
type: integer
format: int64
responses:
'200':
description: successful operation
'400':
description: Invalid ID supplied
'404':
description: Pet not found
'/user/{username}':
get:
tags:
- user
summary: Get user by user name
description: ''
operationId: getObject
parameters:
- name: username
in: path
description: The name that needs to be fetched. Use user1 for testing.
required: true
schema:
type: string
responses:
'200':
description: successful operation
'400':
description: Invalid username supplied
'404':
description: User not found
externalDocs:
description: Find out more about Swagger
url: 'http://swagger.io'