Skip to content

Commit c8b07f7

Browse files
committed
add some tests
added some tests to `modules/openapi-generator/src/test/resources/3_0/go/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml` and regenerated the samples
1 parent 907f10c commit c8b07f7

File tree

12 files changed

+1139
-0
lines changed

12 files changed

+1139
-0
lines changed

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

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,22 @@ paths:
12331233
responses:
12341234
'200':
12351235
description: OK
1236+
/fake/deep_object_anyof_test:
1237+
get:
1238+
tags:
1239+
- fake
1240+
operationId: test_query_deep_object_anyof
1241+
parameters:
1242+
- name: filter
1243+
in: query
1244+
required: false
1245+
style: deepObject
1246+
schema:
1247+
$ref: '#/components/schemas/FilterAny'
1248+
explode: false
1249+
responses:
1250+
'200':
1251+
description: OK
12361252
/fake/parameter-name-mapping:
12371253
get:
12381254
tags:
@@ -1375,6 +1391,41 @@ components:
13751391
type: http
13761392
scheme: signature
13771393
schemas:
1394+
FilterTypeRegex:
1395+
type: object
1396+
properties:
1397+
type:
1398+
enum:
1399+
- set
1400+
- range
1401+
type: string
1402+
regex:
1403+
type: string
1404+
required:
1405+
- type
1406+
FilterTypeRange:
1407+
type: object
1408+
properties:
1409+
type:
1410+
enum:
1411+
- set
1412+
- range
1413+
type: string
1414+
data:
1415+
type: array
1416+
items:
1417+
type: string
1418+
required:
1419+
- type
1420+
FilterAny:
1421+
anyOf:
1422+
- $ref: '#/components/schemas/FilterTypeRegex'
1423+
- $ref: '#/components/schemas/FilterTypeRange'
1424+
discriminator:
1425+
mapping:
1426+
set: '#/components/schemas/FilterTypeRegex'
1427+
range: '#/components/schemas/FilterTypeRange'
1428+
propertyName: type
13781429
MapWithDateTime:
13791430
type: object
13801431
additionalProperties:

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ docs/FakeAPI.md
4040
docs/FakeClassnameTags123API.md
4141
docs/File.md
4242
docs/FileSchemaTestClass.md
43+
docs/FilterAny.md
44+
docs/FilterTypeRange.md
45+
docs/FilterTypeRegex.md
4346
docs/Foo.md
4447
docs/FooGetDefaultResponse.md
4548
docs/FormatTest.md
@@ -116,6 +119,9 @@ model_enum_class.go
116119
model_enum_test_.go
117120
model_file.go
118121
model_file_schema_test_class.go
122+
model_filter_any.go
123+
model_filter_type_range.go
124+
model_filter_type_regex.go
119125
model_foo.go
120126
model_format_test_.go
121127
model_fruit.go

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Class | Method | HTTP request | Description
9999
*FakeAPI* | [**TestInlineFreeformAdditionalProperties**](docs/FakeAPI.md#testinlinefreeformadditionalproperties) | **Post** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties
100100
*FakeAPI* | [**TestJsonFormData**](docs/FakeAPI.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data
101101
*FakeAPI* | [**TestQueryDeepObject**](docs/FakeAPI.md#testquerydeepobject) | **Get** /fake/deep_object_test |
102+
*FakeAPI* | [**TestQueryDeepObjectAnyof**](docs/FakeAPI.md#testquerydeepobjectanyof) | **Get** /fake/deep_object_anyof_test |
102103
*FakeAPI* | [**TestQueryParameterCollectionFormat**](docs/FakeAPI.md#testqueryparametercollectionformat) | **Put** /fake/test-query-parameters |
103104
*FakeAPI* | [**TestStringMapReference**](docs/FakeAPI.md#teststringmapreference) | **Post** /fake/stringMap-reference | test referenced string map
104105
*FakeAPI* | [**TestUniqueItemsHeaderAndQueryParameterCollectionFormat**](docs/FakeAPI.md#testuniqueitemsheaderandqueryparametercollectionformat) | **Put** /fake/test-unique-parameters |
@@ -153,6 +154,9 @@ Class | Method | HTTP request | Description
153154
- [EnumTest](docs/EnumTest.md)
154155
- [File](docs/File.md)
155156
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
157+
- [FilterAny](docs/FilterAny.md)
158+
- [FilterTypeRange](docs/FilterTypeRange.md)
159+
- [FilterTypeRegex](docs/FilterTypeRegex.md)
156160
- [Foo](docs/Foo.md)
157161
- [FooGetDefaultResponse](docs/FooGetDefaultResponse.md)
158162
- [FormatTest](docs/FormatTest.md)

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

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,22 @@ paths:
11901190
description: OK
11911191
tags:
11921192
- fake
1193+
/fake/deep_object_anyof_test:
1194+
get:
1195+
operationId: test_query_deep_object_anyof
1196+
parameters:
1197+
- explode: false
1198+
in: query
1199+
name: filter
1200+
required: false
1201+
schema:
1202+
$ref: '#/components/schemas/FilterAny'
1203+
style: deepObject
1204+
responses:
1205+
"200":
1206+
description: OK
1207+
tags:
1208+
- fake
11931209
/fake/parameter-name-mapping:
11941210
get:
11951211
operationId: getParameterNameMapping
@@ -1278,6 +1294,41 @@ components:
12781294
description: Pet object that needs to be added to the store
12791295
required: true
12801296
schemas:
1297+
FilterTypeRegex:
1298+
properties:
1299+
type:
1300+
enum:
1301+
- set
1302+
- range
1303+
type: string
1304+
regex:
1305+
type: string
1306+
required:
1307+
- type
1308+
type: object
1309+
FilterTypeRange:
1310+
properties:
1311+
type:
1312+
enum:
1313+
- set
1314+
- range
1315+
type: string
1316+
data:
1317+
items:
1318+
type: string
1319+
type: array
1320+
required:
1321+
- type
1322+
type: object
1323+
FilterAny:
1324+
anyOf:
1325+
- $ref: '#/components/schemas/FilterTypeRegex'
1326+
- $ref: '#/components/schemas/FilterTypeRange'
1327+
discriminator:
1328+
mapping:
1329+
set: '#/components/schemas/FilterTypeRegex'
1330+
range: '#/components/schemas/FilterTypeRange'
1331+
propertyName: type
12811332
MapWithDateTime:
12821333
additionalProperties:
12831334
items:

samples/openapi3/client/petstore/go/go-petstore/api_fake.go

Lines changed: 106 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Method | HTTP request | Description
2121
[**TestInlineFreeformAdditionalProperties**](FakeAPI.md#TestInlineFreeformAdditionalProperties) | **Post** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties
2222
[**TestJsonFormData**](FakeAPI.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data
2323
[**TestQueryDeepObject**](FakeAPI.md#TestQueryDeepObject) | **Get** /fake/deep_object_test |
24+
[**TestQueryDeepObjectAnyof**](FakeAPI.md#TestQueryDeepObjectAnyof) | **Get** /fake/deep_object_anyof_test |
2425
[**TestQueryParameterCollectionFormat**](FakeAPI.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-parameters |
2526
[**TestStringMapReference**](FakeAPI.md#TestStringMapReference) | **Post** /fake/stringMap-reference | test referenced string map
2627
[**TestUniqueItemsHeaderAndQueryParameterCollectionFormat**](FakeAPI.md#TestUniqueItemsHeaderAndQueryParameterCollectionFormat) | **Put** /fake/test-unique-parameters |
@@ -1177,6 +1178,68 @@ No authorization required
11771178
[[Back to README]](../README.md)
11781179

11791180

1181+
## TestQueryDeepObjectAnyof
1182+
1183+
> TestQueryDeepObjectAnyof(ctx).Filter(filter).Execute()
1184+
1185+
1186+
1187+
### Example
1188+
1189+
```go
1190+
package main
1191+
1192+
import (
1193+
"context"
1194+
"fmt"
1195+
"os"
1196+
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
1197+
)
1198+
1199+
func main() {
1200+
filter := *openapiclient.NewFilterAny("Type_example") // FilterAny | (optional)
1201+
1202+
configuration := openapiclient.NewConfiguration()
1203+
apiClient := openapiclient.NewAPIClient(configuration)
1204+
r, err := apiClient.FakeAPI.TestQueryDeepObjectAnyof(context.Background()).Filter(filter).Execute()
1205+
if err != nil {
1206+
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestQueryDeepObjectAnyof``: %v\n", err)
1207+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
1208+
}
1209+
}
1210+
```
1211+
1212+
### Path Parameters
1213+
1214+
1215+
1216+
### Other Parameters
1217+
1218+
Other parameters are passed through a pointer to a apiTestQueryDeepObjectAnyofRequest struct via the builder pattern
1219+
1220+
1221+
Name | Type | Description | Notes
1222+
------------- | ------------- | ------------- | -------------
1223+
**filter** | [**FilterAny**](FilterAny.md) | |
1224+
1225+
### Return type
1226+
1227+
(empty response body)
1228+
1229+
### Authorization
1230+
1231+
No authorization required
1232+
1233+
### HTTP request headers
1234+
1235+
- **Content-Type**: Not defined
1236+
- **Accept**: Not defined
1237+
1238+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
1239+
[[Back to Model list]](../README.md#documentation-for-models)
1240+
[[Back to README]](../README.md)
1241+
1242+
11801243
## TestQueryParameterCollectionFormat
11811244

11821245
> TestQueryParameterCollectionFormat(ctx).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute()

0 commit comments

Comments
 (0)