Files
fastapi-openapi-to-postman/test/data/validationData/issues/issue#478/global-servers-path-variables-two-vars-wrong-spec.yaml
Erik Mendoza 44c4d2ed54 Fixing issue #478, path variables matching validation
The path variables provided in transactions will be validated with the path variables in spec. If they does not match it will be generated a mismatch with INVALID_VALUE reasonCode.
2022-03-14 11:22:34 -06:00

84 lines
1.8 KiB
YAML

openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger Petstore
license:
name: MIT
servers:
- url: https://{username}.myTestServer.com:{port}/{basePath}
description: Common url for all operations in this path
variables:
username:
default: demo
description: Assigned by the service provider
port:
enum:
- '8843'
- '443'
default: '8843'
basePath:
default: v2
paths:
/pets/{peterId}/{correctName}:
get:
summary: Info for a specific pet
operationId: showPetById
tags:
- pets
parameters:
- name: peterId
in: path
required: true
description: The id of the pet to retrieve
schema:
type: string
- name: correctName
in: path
required: true
description: A test id
schema:
type: string
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: "#/components/schemas/Pet"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
schemas:
Pet:
type: object
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tag:
type: string
Pets:
type: array
items:
$ref: "#/components/schemas/Pet"
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string