[Inline model resolver] various improvements (#12293)

* better handling of requestbody in the inline resolver

* remove commented code

* better request body naming

* fix unique naming

* minor code format change

* removed additional underscore from names, fix test

* more fixes, update tests

* fix all tests

* undo changes to default codegen

* update samples

* update python tests

* add new files

* update samples
This commit is contained in:
William Cheng
2022-05-10 17:13:57 +08:00
committed by GitHub
parent 4d0da694ba
commit ad3b5f7045
186 changed files with 9764 additions and 8111 deletions

View File

@@ -271,18 +271,10 @@ paths:
type: integer
style: simple
requestBody:
$ref: '#/components/requestBodies/inline_object'
content:
application/x-www-form-urlencoded:
schema:
properties:
name:
description: Updated name of the pet
type: string
status:
description: Updated status of the pet
type: string
type: object
$ref: '#/components/schemas/updatePetWithForm_request'
responses:
"200":
description: Successful operation
@@ -312,19 +304,10 @@ paths:
type: integer
style: simple
requestBody:
$ref: '#/components/requestBodies/inline_object_1'
content:
multipart/form-data:
schema:
properties:
additionalMetadata:
description: Additional data to pass to server
type: string
file:
description: file to upload
format: binary
type: string
type: object
$ref: '#/components/schemas/uploadFile_request'
responses:
"200":
content:
@@ -814,29 +797,10 @@ paths:
type: array
style: form
requestBody:
$ref: '#/components/requestBodies/inline_object_2'
content:
application/x-www-form-urlencoded:
schema:
properties:
enum_form_string_array:
description: Form parameter enum test (string array)
items:
default: $
enum:
- '>'
- $
type: string
type: array
enum_form_string:
default: -efg
description: Form parameter enum test (string)
enum:
- _abc
- -efg
- (xyz)
type: string
type: object
$ref: '#/components/schemas/testEnumParameters_request'
responses:
"400":
description: Invalid request
@@ -872,81 +836,10 @@ paths:
가짜 엔드 포인트
operationId: testEndpointParameters
requestBody:
$ref: '#/components/requestBodies/inline_object_3'
content:
application/x-www-form-urlencoded:
schema:
properties:
integer:
description: None
maximum: 100
minimum: 10
type: integer
int32:
description: None
format: int32
maximum: 200
minimum: 20
type: integer
int64:
description: None
format: int64
type: integer
number:
description: None
maximum: 543.2
minimum: 32.1
type: number
float:
description: None
format: float
maximum: 987.6
type: number
double:
description: None
format: double
maximum: 123.4
minimum: 67.8
type: number
string:
description: None
pattern: "/[a-z]/i"
type: string
pattern_without_delimiter:
description: None
pattern: "^[A-Z].*"
type: string
byte:
description: None
format: byte
type: string
binary:
description: None
format: binary
type: string
date:
description: None
format: date
type: string
dateTime:
description: None
format: date-time
type: string
password:
description: None
format: password
maxLength: 64
minLength: 10
type: string
callback:
description: None
type: string
required:
- byte
- double
- number
- pattern_without_delimiter
type: object
$ref: '#/components/schemas/testEndpointParameters_request'
responses:
"400":
description: Invalid username supplied
@@ -1074,21 +967,10 @@ paths:
description: ""
operationId: testJsonFormData
requestBody:
$ref: '#/components/requestBodies/inline_object_4'
content:
application/x-www-form-urlencoded:
schema:
properties:
param:
description: field1
type: string
param2:
description: field2
type: string
required:
- param
- param2
type: object
$ref: '#/components/schemas/testJsonFormData_request'
responses:
"200":
description: successful operation
@@ -1287,21 +1169,10 @@ paths:
type: integer
style: simple
requestBody:
$ref: '#/components/requestBodies/inline_object_5'
content:
multipart/form-data:
schema:
properties:
additionalMetadata:
description: Additional data to pass to server
type: string
requiredFile:
description: file to upload
format: binary
type: string
required:
- requiredFile
type: object
$ref: '#/components/schemas/uploadFileWithRequiredFile_request'
responses:
"200":
content:
@@ -1391,36 +1262,6 @@ components:
$ref: '#/components/schemas/Pet'
description: Pet object that needs to be added to the store
required: true
inline_object:
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/inline_object'
inline_object_1:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/inline_object_1'
inline_object_2:
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/inline_object_2'
inline_object_3:
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/inline_object_3'
inline_object_4:
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/inline_object_4'
inline_object_5:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/inline_object_5'
schemas:
Foo:
example:
@@ -2136,7 +1977,7 @@ components:
string:
$ref: '#/components/schemas/Foo'
type: object
inline_object:
updatePetWithForm_request:
properties:
name:
description: Updated name of the pet
@@ -2145,7 +1986,7 @@ components:
description: Updated status of the pet
type: string
type: object
inline_object_1:
uploadFile_request:
properties:
additionalMetadata:
description: Additional data to pass to server
@@ -2155,7 +1996,7 @@ components:
format: binary
type: string
type: object
inline_object_2:
testEnumParameters_request:
properties:
enum_form_string_array:
description: Form parameter enum test (string array)
@@ -2175,7 +2016,7 @@ components:
- (xyz)
type: string
type: object
inline_object_3:
testEndpointParameters_request:
properties:
integer:
description: None
@@ -2247,7 +2088,7 @@ components:
- number
- pattern_without_delimiter
type: object
inline_object_4:
testJsonFormData_request:
properties:
param:
description: field1
@@ -2259,7 +2100,7 @@ components:
- param
- param2
type: object
inline_object_5:
uploadFileWithRequiredFile_request:
properties:
additionalMetadata:
description: Additional data to pass to server