[python] Add tests and fix enum path parameters (#16769)

* test: Tests for enum params in path, query and header

* fix: Get enum ref values correctly in path parameters

Closes #16688

* fix java tests failure

---------

Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
Robert Schweizer
2023-10-10 11:10:30 +02:00
committed by GitHub
parent 7bb75f4bb4
commit 9e07f85eb5
88 changed files with 1549 additions and 538 deletions

View File

@@ -11,10 +11,10 @@ info:
servers:
- url: http://localhost:3000/
paths:
/path/string/{path_string}/integer/{path_integer}:
/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}:
get:
description: Test path parameter(s)
operationId: "tests/path/string/{path_string}/integer/{path_integer}"
operationId: "tests/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}"
parameters:
- explode: false
in: path
@@ -30,6 +30,24 @@ paths:
schema:
type: integer
style: simple
- explode: false
in: path
name: enum_nonref_string_path
required: true
schema:
enum:
- success
- failure
- unclassified
type: string
style: simple
- explode: false
in: path
name: enum_ref_string_path
required: true
schema:
$ref: '#/components/schemas/StringEnumRef'
style: simple
responses:
"200":
content:
@@ -83,10 +101,10 @@ paths:
- form
x-content-type: application/x-www-form-urlencoded
x-accepts: text/plain
/header/integer/boolean/string:
/header/integer/boolean/string/enums:
get:
description: Test header parameter(s)
operationId: test/header/integer/boolean/string
operationId: test/header/integer/boolean/string/enums
parameters:
- explode: true
in: header
@@ -109,6 +127,24 @@ paths:
schema:
type: string
style: form
- explode: true
in: header
name: enum_nonref_string_header
required: false
schema:
enum:
- success
- failure
- unclassified
type: string
style: form
- explode: true
in: header
name: enum_ref_string_header
required: false
schema:
$ref: '#/components/schemas/StringEnumRef'
style: form
responses:
"200":
content:
@@ -125,6 +161,17 @@ paths:
description: Test query parameter(s)
operationId: test/enum_ref_string
parameters:
- explode: true
in: query
name: enum_nonref_string_query
required: false
schema:
enum:
- success
- failure
- unclassified
type: string
style: form
- explode: true
in: query
name: enum_ref_string_query