Skip to content

Commit d862b8f

Browse files
committed
chore(go): add failing test
1 parent 008c1a4 commit d862b8f

File tree

15 files changed

+343
-209
lines changed

15 files changed

+343
-209
lines changed

modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml

+17-11
Original file line numberDiff line numberDiff line change
@@ -1394,23 +1394,13 @@ components:
13941394
FilterTypeRegex:
13951395
type: object
13961396
properties:
1397-
type:
1398-
enum:
1399-
- set
1400-
- range
1401-
type: string
14021397
regex:
14031398
type: string
14041399
required:
14051400
- type
14061401
FilterTypeRange:
14071402
type: object
14081403
properties:
1409-
type:
1410-
enum:
1411-
- set
1412-
- range
1413-
type: string
14141404
data:
14151405
type: array
14161406
items:
@@ -1425,7 +1415,16 @@ components:
14251415
mapping:
14261416
set: '#/components/schemas/FilterTypeRegex'
14271417
range: '#/components/schemas/FilterTypeRange'
1428-
propertyName: type
1418+
propertyName: type
1419+
properties:
1420+
type:
1421+
enum:
1422+
- set
1423+
- range
1424+
type: string
1425+
date:
1426+
type: string
1427+
format: date-time
14291428
MapWithDateTime:
14301429
type: object
14311430
additionalProperties:
@@ -2119,6 +2118,13 @@ components:
21192118
type: string
21202119
required:
21212120
- className
2121+
fruitJuice:
2122+
type: object
2123+
required:
2124+
- fruit
2125+
properties:
2126+
fruit:
2127+
$ref: '#/components/schemas/gmFruit'
21222128
gmFruit:
21232129
properties:
21242130
color:

samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ docs/Foo.md
4747
docs/FooGetDefaultResponse.md
4848
docs/FormatTest.md
4949
docs/Fruit.md
50+
docs/FruitJuice.md
5051
docs/FruitReq.md
5152
docs/GmFruit.md
5253
docs/HasOnlyReadOnly.md
@@ -126,6 +127,7 @@ model_filter_type_regex.go
126127
model_foo.go
127128
model_format_test_.go
128129
model_fruit.go
130+
model_fruit_juice.go
129131
model_fruit_req.go
130132
model_gm_fruit.go
131133
model_has_only_read_only.go

samples/openapi3/client/petstore/go/go-petstore/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ Class | Method | HTTP request | Description
161161
- [FooGetDefaultResponse](docs/FooGetDefaultResponse.md)
162162
- [FormatTest](docs/FormatTest.md)
163163
- [Fruit](docs/Fruit.md)
164+
- [FruitJuice](docs/FruitJuice.md)
164165
- [FruitReq](docs/FruitReq.md)
165166
- [GmFruit](docs/GmFruit.md)
166167
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)

samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml

+16-10
Original file line numberDiff line numberDiff line change
@@ -1296,23 +1296,13 @@ components:
12961296
schemas:
12971297
FilterTypeRegex:
12981298
properties:
1299-
type:
1300-
enum:
1301-
- set
1302-
- range
1303-
type: string
13041299
regex:
13051300
type: string
13061301
required:
13071302
- type
13081303
type: object
13091304
FilterTypeRange:
13101305
properties:
1311-
type:
1312-
enum:
1313-
- set
1314-
- range
1315-
type: string
13161306
data:
13171307
items:
13181308
type: string
@@ -1329,6 +1319,15 @@ components:
13291319
set: '#/components/schemas/FilterTypeRegex'
13301320
range: '#/components/schemas/FilterTypeRange'
13311321
propertyName: type
1322+
properties:
1323+
type:
1324+
enum:
1325+
- set
1326+
- range
1327+
type: string
1328+
date:
1329+
format: date-time
1330+
type: string
13321331
MapWithDateTime:
13331332
additionalProperties:
13341333
items:
@@ -2101,6 +2100,13 @@ components:
21012100
required:
21022101
- className
21032102
type: object
2103+
fruitJuice:
2104+
properties:
2105+
fruit:
2106+
$ref: '#/components/schemas/gmFruit'
2107+
required:
2108+
- fruit
2109+
type: object
21042110
gmFruit:
21052111
anyOf:
21062112
- $ref: '#/components/schemas/apple'

samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ import (
11971197
)
11981198

11991199
func main() {
1200-
filter := *openapiclient.NewFilterAny("Type_example") // FilterAny | (optional)
1200+
filter := *openapiclient.NewFilterAny() // FilterAny | (optional)
12011201

12021202
configuration := openapiclient.NewConfiguration()
12031203
apiClient := openapiclient.NewAPIClient(configuration)

samples/openapi3/client/petstore/go/go-petstore/docs/FilterAny.md

+33-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**Type** | **string** | |
7+
**Type** | Pointer to **string** | | [optional]
8+
**Date** | Pointer to **time.Time** | | [optional]
89
**Regex** | Pointer to **string** | | [optional]
910
**Data** | Pointer to **[]string** | | [optional]
1011

1112
## Methods
1213

1314
### NewFilterAny
1415

15-
`func NewFilterAny(type_ string, ) *FilterAny`
16+
`func NewFilterAny() *FilterAny`
1617

1718
NewFilterAny instantiates a new FilterAny object
1819
This constructor will assign default values to properties that have it defined,
@@ -46,6 +47,36 @@ and a boolean to check if the value has been set.
4647

4748
SetType sets Type field to given value.
4849

50+
### HasType
51+
52+
`func (o *FilterAny) HasType() bool`
53+
54+
HasType returns a boolean if a field has been set.
55+
56+
### GetDate
57+
58+
`func (o *FilterAny) GetDate() time.Time`
59+
60+
GetDate returns the Date field if non-nil, zero value otherwise.
61+
62+
### GetDateOk
63+
64+
`func (o *FilterAny) GetDateOk() (*time.Time, bool)`
65+
66+
GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise
67+
and a boolean to check if the value has been set.
68+
69+
### SetDate
70+
71+
`func (o *FilterAny) SetDate(v time.Time)`
72+
73+
SetDate sets Date field to given value.
74+
75+
### HasDate
76+
77+
`func (o *FilterAny) HasDate() bool`
78+
79+
HasDate returns a boolean if a field has been set.
4980

5081
### GetRegex
5182

samples/openapi3/client/petstore/go/go-petstore/docs/FilterTypeRange.md

+1-22
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**Type** | **string** | |
87
**Data** | Pointer to **[]string** | | [optional]
98

109
## Methods
1110

1211
### NewFilterTypeRange
1312

14-
`func NewFilterTypeRange(type_ string, ) *FilterTypeRange`
13+
`func NewFilterTypeRange() *FilterTypeRange`
1514

1615
NewFilterTypeRange instantiates a new FilterTypeRange object
1716
This constructor will assign default values to properties that have it defined,
@@ -26,26 +25,6 @@ NewFilterTypeRangeWithDefaults instantiates a new FilterTypeRange object
2625
This constructor will only assign default values to properties that have it defined,
2726
but it doesn't guarantee that properties required by API are set
2827

29-
### GetType
30-
31-
`func (o *FilterTypeRange) GetType() string`
32-
33-
GetType returns the Type field if non-nil, zero value otherwise.
34-
35-
### GetTypeOk
36-
37-
`func (o *FilterTypeRange) GetTypeOk() (*string, bool)`
38-
39-
GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
40-
and a boolean to check if the value has been set.
41-
42-
### SetType
43-
44-
`func (o *FilterTypeRange) SetType(v string)`
45-
46-
SetType sets Type field to given value.
47-
48-
4928
### GetData
5029

5130
`func (o *FilterTypeRange) GetData() []string`

samples/openapi3/client/petstore/go/go-petstore/docs/FilterTypeRegex.md

+1-22
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**Type** | **string** | |
87
**Regex** | Pointer to **string** | | [optional]
98

109
## Methods
1110

1211
### NewFilterTypeRegex
1312

14-
`func NewFilterTypeRegex(type_ string, ) *FilterTypeRegex`
13+
`func NewFilterTypeRegex() *FilterTypeRegex`
1514

1615
NewFilterTypeRegex instantiates a new FilterTypeRegex object
1716
This constructor will assign default values to properties that have it defined,
@@ -26,26 +25,6 @@ NewFilterTypeRegexWithDefaults instantiates a new FilterTypeRegex object
2625
This constructor will only assign default values to properties that have it defined,
2726
but it doesn't guarantee that properties required by API are set
2827

29-
### GetType
30-
31-
`func (o *FilterTypeRegex) GetType() string`
32-
33-
GetType returns the Type field if non-nil, zero value otherwise.
34-
35-
### GetTypeOk
36-
37-
`func (o *FilterTypeRegex) GetTypeOk() (*string, bool)`
38-
39-
GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
40-
and a boolean to check if the value has been set.
41-
42-
### SetType
43-
44-
`func (o *FilterTypeRegex) SetType(v string)`
45-
46-
SetType sets Type field to given value.
47-
48-
4928
### GetRegex
5029

5130
`func (o *FilterTypeRegex) GetRegex() string`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# FruitJuice
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**Fruit** | [**GmFruit**](GmFruit.md) | |
8+
9+
## Methods
10+
11+
### NewFruitJuice
12+
13+
`func NewFruitJuice(fruit GmFruit, ) *FruitJuice`
14+
15+
NewFruitJuice instantiates a new FruitJuice object
16+
This constructor will assign default values to properties that have it defined,
17+
and makes sure properties required by API are set, but the set of arguments
18+
will change when the set of required properties is changed
19+
20+
### NewFruitJuiceWithDefaults
21+
22+
`func NewFruitJuiceWithDefaults() *FruitJuice`
23+
24+
NewFruitJuiceWithDefaults instantiates a new FruitJuice object
25+
This constructor will only assign default values to properties that have it defined,
26+
but it doesn't guarantee that properties required by API are set
27+
28+
### GetFruit
29+
30+
`func (o *FruitJuice) GetFruit() GmFruit`
31+
32+
GetFruit returns the Fruit field if non-nil, zero value otherwise.
33+
34+
### GetFruitOk
35+
36+
`func (o *FruitJuice) GetFruitOk() (*GmFruit, bool)`
37+
38+
GetFruitOk returns a tuple with the Fruit field if it's non-nil, zero value otherwise
39+
and a boolean to check if the value has been set.
40+
41+
### SetFruit
42+
43+
`func (o *FruitJuice) SetFruit(v GmFruit)`
44+
45+
SetFruit sets Fruit field to given value.
46+
47+
48+
49+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
50+
51+

0 commit comments

Comments
 (0)