Skip to content

Commit 869b17f

Browse files
grokifywing328
authored andcommitted
[Golang][client] delete sample output dir before rebuild (#477)
* delete Go client sample output dir before rebuild * purge go-petstore-withXml samples output dir before build * update samples * fix go-petstore-withxml.sh echo path
1 parent 867aaa4 commit 869b17f

21 files changed

Lines changed: 171 additions & 3193 deletions

bin/go-petstore-withxml.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ then
2525
mvn -B clean package
2626
fi
2727

28+
echo "Removing files and folders under samples/client/petstore/go/go-petstore-withXml"
29+
rm -rf samples/client/petstore/go/go-petstore-withXml
30+
2831
# if you've executed sbt assembly previously it will use that instead.
2932
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
3033
ags="generate -t modules/openapi-generator/src/main/resources/go -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g go -o samples/client/petstore/go/go-petstore-withXml -DpackageName=petstore,withXml=true $@"

bin/go-petstore.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ then
2525
mvn -B clean package
2626
fi
2727

28+
echo "Removing files and folders under samples/client/petstore/go/go-petstore"
29+
rm -rf samples/client/petstore/go/go-petstore
30+
2831
# if you've executed sbt assembly previously it will use that instead.
2932
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
3033
ags="generate -t modules/openapi-generator/src/main/resources/go -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g go -o samples/client/petstore/go/go-petstore -DpackageName=petstore $@"

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Class | Method | HTTP request | Description
3535
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **Post** /fake/outer/composite |
3636
*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **Post** /fake/outer/number |
3737
*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **Post** /fake/outer/string |
38+
*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **Put** /fake/body-with-file-schema |
3839
*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **Put** /fake/body-with-query-params |
3940
*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **Patch** /fake | To test \"client\" model
4041
*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -83,6 +84,8 @@ Class | Method | HTTP request | Description
8384
- [EnumArrays](docs/EnumArrays.md)
8485
- [EnumClass](docs/EnumClass.md)
8586
- [EnumTest](docs/EnumTest.md)
87+
- [File](docs/File.md)
88+
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
8689
- [FormatTest](docs/FormatTest.md)
8790
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
8891
- [List](docs/List.md)

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,22 @@ paths:
973973
summary: To test special tags
974974
tags:
975975
- $another-fake?
976+
/fake/body-with-file-schema:
977+
put:
978+
description: For this test, the body for this request much reference a schema named `File`.
979+
operationId: testBodyWithFileSchema
980+
requestBody:
981+
content:
982+
application/json:
983+
schema:
984+
$ref: '#/components/schemas/FileSchemaTestClass'
985+
required: true
986+
responses:
987+
200:
988+
content: {}
989+
description: Success
990+
tags:
991+
- fake
976992
/fake/{petId}/uploadImageWithRequiredFile:
977993
post:
978994
operationId: uploadFileWithRequiredFile
@@ -1413,6 +1429,21 @@ components:
14131429
OuterBoolean:
14141430
type: boolean
14151431
x-codegen-body-parameter-name: boolean_post_body
1432+
FileSchemaTestClass:
1433+
example:
1434+
file:
1435+
sourceURI: sourceURI
1436+
files:
1437+
- sourceURI: sourceURI
1438+
- sourceURI: sourceURI
1439+
properties:
1440+
file:
1441+
$ref: '#/components/schemas/File'
1442+
files:
1443+
items:
1444+
$ref: '#/components/schemas/File'
1445+
type: array
1446+
type: object
14161447
Animal:
14171448
discriminator:
14181449
propertyName: className
@@ -1475,6 +1506,14 @@ components:
14751506
items:
14761507
$ref: '#/components/schemas/Animal'
14771508
type: array
1509+
File:
1510+
example:
1511+
sourceURI: sourceURI
1512+
properties:
1513+
sourceURI:
1514+
description: Test capitalization
1515+
type: string
1516+
type: object
14781517
Pet:
14791518
example:
14801519
photoUrls:

0 commit comments

Comments
 (0)