fix enum which is not string of Go (#4077)

This commit is contained in:
Akira Tanimura
2019-10-09 19:35:56 +09:00
committed by William Cheng
parent 7a369d3b02
commit 08613691e8
157 changed files with 19858 additions and 197 deletions

View File

@@ -130,7 +130,8 @@ paths:
/pet/findByTags:
get:
deprecated: true
description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
description: Multiple tags can be provided with comma separated strings. Use
tag1, tag2, tag3 for testing.
operationId: findPetsByTags
parameters:
- description: Tags to filter by
@@ -350,7 +351,8 @@ paths:
- store
/store/order/{order_id}:
delete:
description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
description: For valid response try integer IDs with value < 1000. Anything
above 1000 or nonintegers will generate API errors
operationId: deleteOrder
parameters:
- description: ID of the order that needs to be deleted
@@ -370,7 +372,8 @@ paths:
tags:
- store
get:
description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
description: For valid response try integer IDs with value <= 5 or > 10. Other
values will generated exceptions
operationId: getOrderById
parameters:
- description: ID of pet that needs to be fetched
@@ -604,7 +607,6 @@ paths:
name: required_string_group
required: true
schema:
format: int32
type: integer
style: form
- description: Required Boolean in group parameters
@@ -630,7 +632,6 @@ paths:
name: string_group
required: false
schema:
format: int32
type: integer
style: form
- description: Boolean in group parameters
@@ -803,7 +804,6 @@ paths:
properties:
integer:
description: None
format: int32
maximum: 100
minimum: 10
type: integer
@@ -1045,7 +1045,8 @@ paths:
- $another-fake?
/fake/body-with-file-schema:
put:
description: For this test, the body for this request much reference a schema named `File`.
description: For this test, the body for this request much reference a schema
named `File`.
operationId: testBodyWithFileSchema
requestBody:
content:
@@ -1058,6 +1059,61 @@ paths:
description: Success
tags:
- fake
/fake/test-query-paramters:
put:
description: To test the collection format in query parameters
operationId: testQueryParameterCollectionFormat
parameters:
- explode: true
in: query
name: pipe
required: true
schema:
items:
type: string
type: array
style: form
- explode: false
in: query
name: ioutil
required: true
schema:
items:
type: string
type: array
style: form
- explode: false
in: query
name: http
required: true
schema:
items:
type: string
type: array
style: spaceDelimited
- explode: false
in: query
name: url
required: true
schema:
items:
type: string
type: array
style: form
- explode: true
in: query
name: context
required: true
schema:
items:
type: string
type: array
style: form
responses:
200:
description: Success
tags:
- fake
/fake/{petId}/uploadImageWithRequiredFile:
post:
operationId: uploadFileWithRequiredFile
@@ -1368,7 +1424,6 @@ components:
property:
type: string
123Number:
format: int32
readOnly: true
type: integer
required:
@@ -1393,17 +1448,11 @@ components:
Dog:
allOf:
- $ref: '#/components/schemas/Animal'
- properties:
breed:
type: string
type: object
- $ref: '#/components/schemas/Dog_allOf'
Cat:
allOf:
- $ref: '#/components/schemas/Animal'
- properties:
declawed:
type: boolean
type: object
- $ref: '#/components/schemas/Cat_allOf'
Animal:
discriminator:
propertyName: className
@@ -1423,7 +1472,6 @@ components:
format_test:
properties:
integer:
format: int32
maximum: 100
minimum: 10
type: integer
@@ -1478,7 +1526,8 @@ components:
pattern: ^\d{10}$
type: string
pattern_with_digits_and_delimiter:
description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
description: A string starting with 'image_' (case insensitive) and one
to three digits following i.e. Image_01.
pattern: /^image_\d{1,3}$/i
type: string
required:
@@ -1625,6 +1674,7 @@ components:
indirect_map:
additionalProperties:
type: boolean
type: object
type: object
ArrayTest:
properties:
@@ -1687,13 +1737,13 @@ components:
- placed
- approved
- delivered
nullable: true
type: string
OuterEnumInteger:
enum:
- 0
- 1
- 2
format: int32
type: integer
OuterEnumDefaultValue:
default: placed
@@ -1708,7 +1758,6 @@ components:
- 0
- 1
- 2
format: int32
type: integer
OuterComposite:
example:
@@ -1734,6 +1783,7 @@ components:
StringBooleanMap:
additionalProperties:
type: boolean
type: object
FileSchemaTestClass:
example:
file:
@@ -1766,7 +1816,8 @@ components:
xml:
name: $special[model.name]
HealthCheckResult:
description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
description: Just a string to inform instance is up and running. Make it nullable
in hope to get it as pointer in generated model.
example:
NullableMessage: NullableMessage
properties:
@@ -1774,6 +1825,64 @@ components:
nullable: true
type: string
type: object
NullableClass:
additionalProperties:
nullable: true
type: object
properties:
integer_prop:
nullable: true
type: integer
number_prop:
nullable: true
type: number
boolean_prop:
nullable: true
type: boolean
string_prop:
nullable: true
type: string
date_prop:
format: date
nullable: true
type: string
datetime_prop:
format: date-time
nullable: true
type: string
array_nullable_prop:
items:
type: object
nullable: true
type: array
array_and_items_nullable_prop:
items:
nullable: true
type: object
nullable: true
type: array
array_items_nullable:
items:
nullable: true
type: object
type: array
object_nullable_prop:
additionalProperties:
type: object
nullable: true
type: object
object_and_items_nullable_prop:
additionalProperties:
nullable: true
type: object
nullable: true
type: object
object_items_nullable:
additionalProperties:
nullable: true
type: object
type: object
type: object
inline_response_default:
example:
string:
@@ -1824,7 +1933,6 @@ components:
properties:
integer:
description: None
format: int32
maximum: 100
minimum: 10
type: integer
@@ -1917,6 +2025,14 @@ components:
required:
- requiredFile
type: object
Dog_allOf:
properties:
breed:
type: string
Cat_allOf:
properties:
declawed:
type: boolean
securitySchemes:
petstore_auth:
flows: