Skip to content

Commit 9871d89

Browse files
committed
fix: add CI trigger path for new sample and align nullableReturnType in api_doc template
- Add workflow trigger path for kotlin-jvm-spring-3-restclient-nullable-return sample so changes in that directory actually run CI. - Propagate nullableReturnType into the signature and return-type sections of api_doc.mustache (previously only the example code showed the '?'). - Regenerate DefaultApi.md for the new sample to reflect the fix.
1 parent 3504c25 commit 9871d89

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

.github/workflows/samples-kotlin-client.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ on:
66
- 'samples/client/petstore/kotlin*/**'
77
- 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**'
88
- samples/client/others/kotlin-integer-enum/**
9+
- samples/client/others/kotlin-jvm-spring-3-restclient-nullable-return/**
910
pull_request:
1011
paths:
1112
- 'samples/client/petstore/kotlin*/**'
1213
- 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**'
1314
- samples/client/others/kotlin-integer-enum/**
1415
- samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/**
16+
- samples/client/others/kotlin-jvm-spring-3-restclient-nullable-return/**
1517

1618
jobs:
1719
build:

modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ All URIs are relative to *{{basePath}}*
1212
{{#operation}}
1313
<a id="{{operationId}}"></a>
1414
# **{{operationId}}**
15-
> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
15+
> {{#returnType}}{{.}}{{#nullableReturnType}}?{{/nullableReturnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
1616

1717
{{summary}}{{#notes}}
1818

@@ -55,7 +55,7 @@ This endpoint does not need any parameter.
5555

5656
### Return type
5757

58-
{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#generateModelDocs}}[**{{returnType}}**]({{returnBaseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{returnType}}**{{/generateModelDocs}}{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}}
58+
{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}{{#nullableReturnType}}?{{/nullableReturnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#generateModelDocs}}[**{{returnType}}{{#nullableReturnType}}?{{/nullableReturnType}}**]({{returnBaseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{returnType}}{{#nullableReturnType}}?{{/nullableReturnType}}**{{/generateModelDocs}}{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}}
5959

6060
### Authorization
6161

samples/client/others/kotlin-jvm-spring-3-restclient-nullable-return/docs/DefaultApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ No authorization required
5050

5151
<a id="returnNullableString"></a>
5252
# **returnNullableString**
53-
> kotlin.String returnNullableString(pingRequest)
53+
> kotlin.String? returnNullableString(pingRequest)
5454
5555

5656

@@ -81,7 +81,7 @@ try {
8181

8282
### Return type
8383

84-
**kotlin.String**
84+
**kotlin.String?**
8585

8686
### Authorization
8787

0 commit comments

Comments
 (0)