Skip to content

Commit

Permalink
added to petstore an example to trigger the issue which this PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vingarzan committed Jan 20, 2025
1 parent 3cba622 commit 389ffb4
Show file tree
Hide file tree
Showing 13 changed files with 768 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,24 @@ paths:
$ref: '#/components/schemas/User'
description: Created user object
required: true
put:
tags:
- user
summary: Create user
description: This can only be done by the logged in user.
operationId: createUserNullable
responses:
default:
description: successful operation
security:
- api_key: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UserNullable'
description: Created user object, with a nullable bodyParam
required: true
/user/createWithArray:
post:
tags:
Expand Down Expand Up @@ -1052,6 +1070,66 @@ components:
name: User
required:
- deepSliceModel
UserNullable:
title: a User
description: A User who is purchasing from the pet store
type: object
nullable: true
properties:
id:
type: integer
format: int64
username:
type: string
firstName:
type: string
lastName:
type: string
email:
type: string
password:
type: string
phone:
type: string
nullable: true
userStatus:
type: integer
format: int32
description: User Status
deepSliceModel:
nullable: true
type: array
description: An array 1-deep.
items:
type: array
description: An array 2-deep.
items:
type: array
description: An array 3-deep.
items:
$ref: '#/components/schemas/Tag'
deepSliceMap:
type: array
description: An array 1-deep.
items:
type: array
description: An array 2-deep.
items:
title: an Object
type: object
description: An array 3-deep.
properties:
tag:
$ref: '#/components/schemas/Tag'
Pet:
type: array
description: An array of pet.
items:
$ref: '#/components/schemas/Pet'
xml:
name: User
required:
- deepSliceModel
Tag:
title: Pet Tag
description: A tag for a pet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ go/model_special_info.go
go/model_species.go
go/model_tag.go
go/model_user.go
go/model_user_nullable.go
go/routers.go
main.go
223 changes: 223 additions & 0 deletions samples/server/petstore/go-api-server/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,24 @@ paths:
summary: Create user
tags:
- user
put:
description: This can only be done by the logged in user.
operationId: createUserNullable
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UserNullable'
description: "Created user object, with a nullable bodyParam"
required: true
responses:
default:
description: successful operation
security:
- api_key: []
summary: Create user
tags:
- user
/user/createWithArray:
post:
description: ""
Expand Down Expand Up @@ -1240,6 +1258,211 @@ components:
type: object
xml:
name: User
UserNullable:
description: A User who is purchasing from the pet store
example:
firstName: firstName
lastName: lastName
password: password
userStatus: 6
phone: phone
deepSliceModel:
- - - name: name
id: 1
- name: name
id: 1
- - name: name
id: 1
- name: name
id: 1
- - - name: name
id: 1
- name: name
id: 1
- - name: name
id: 1
- name: name
id: 1
id: 0
deepSliceMap:
- - tag:
name: name
id: 1
Pet:
- photoUrls:
- photoUrls
- photoUrls
name: doggie
id: 0
category:
name: name
id: 6
tags:
- name: name
id: 1
- name: name
id: 1
status: available
- photoUrls:
- photoUrls
- photoUrls
name: doggie
id: 0
category:
name: name
id: 6
tags:
- name: name
id: 1
- name: name
id: 1
status: available
- tag:
name: name
id: 1
Pet:
- photoUrls:
- photoUrls
- photoUrls
name: doggie
id: 0
category:
name: name
id: 6
tags:
- name: name
id: 1
- name: name
id: 1
status: available
- photoUrls:
- photoUrls
- photoUrls
name: doggie
id: 0
category:
name: name
id: 6
tags:
- name: name
id: 1
- name: name
id: 1
status: available
- - tag:
name: name
id: 1
Pet:
- photoUrls:
- photoUrls
- photoUrls
name: doggie
id: 0
category:
name: name
id: 6
tags:
- name: name
id: 1
- name: name
id: 1
status: available
- photoUrls:
- photoUrls
- photoUrls
name: doggie
id: 0
category:
name: name
id: 6
tags:
- name: name
id: 1
- name: name
id: 1
status: available
- tag:
name: name
id: 1
Pet:
- photoUrls:
- photoUrls
- photoUrls
name: doggie
id: 0
category:
name: name
id: 6
tags:
- name: name
id: 1
- name: name
id: 1
status: available
- photoUrls:
- photoUrls
- photoUrls
name: doggie
id: 0
category:
name: name
id: 6
tags:
- name: name
id: 1
- name: name
id: 1
status: available
email: email
username: username
nullable: true
properties:
id:
format: int64
type: integer
username:
type: string
firstName:
type: string
lastName:
type: string
email:
type: string
password:
type: string
phone:
nullable: true
type: string
userStatus:
description: User Status
format: int32
type: integer
deepSliceModel:
description: An array 1-deep.
items:
description: An array 2-deep.
items:
description: An array 3-deep.
items:
$ref: '#/components/schemas/Tag'
type: array
type: array
nullable: true
type: array
deepSliceMap:
description: An array 1-deep.
items:
description: An array 2-deep.
items:
$ref: '#/components/schemas/an_Object'
type: array
type: array
required:
- deepSliceModel
title: a User
type: object
xml:
name: User
Tag:
description: A tag for a pet
example:
Expand Down
2 changes: 2 additions & 0 deletions samples/server/petstore/go-api-server/go/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions samples/server/petstore/go-api-server/go/api_user.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 389ffb4

Please sign in to comment.