Skip to content

Commit 7a65094

Browse files
committed
fix javadoc
1 parent da86be4 commit 7a65094

21 files changed

Lines changed: 87 additions & 72 deletions

File tree

modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class CodegenOperation {
3333
hasErrorResponseObject; // if 4xx, 5xx responses have at least one error object defined
3434
public CodegenProperty returnProperty;
3535
public String path, operationId, returnType, returnFormat, httpMethod, returnBaseType,
36-
returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse;
36+
returnContainer, summary, unescapedSummary, unescapedNotes, notes, baseName, defaultResponse;
3737
public CodegenDiscriminator discriminator;
3838
public List<Map<String, String>> consumes, produces, prioritizedContentTypes;
3939
public List<CodegenServer> servers = new ArrayList<CodegenServer>();
@@ -429,6 +429,7 @@ public String toString() {
429429
sb.append(", returnBaseType='").append(returnBaseType).append('\'');
430430
sb.append(", returnContainer='").append(returnContainer).append('\'');
431431
sb.append(", summary='").append(summary).append('\'');
432+
sb.append(", unescapedSummary='").append(unescapedSummary).append('\'');
432433
sb.append(", unescapedNotes='").append(unescapedNotes).append('\'');
433434
sb.append(", notes='").append(notes).append('\'');
434435
sb.append(", baseName='").append(baseName).append('\'');
@@ -502,6 +503,7 @@ public boolean equals(Object o) {
502503
Objects.equals(returnBaseType, that.returnBaseType) &&
503504
Objects.equals(returnContainer, that.returnContainer) &&
504505
Objects.equals(summary, that.summary) &&
506+
Objects.equals(unescapedSummary, that.unescapedSummary) &&
505507
Objects.equals(unescapedNotes, that.unescapedNotes) &&
506508
Objects.equals(notes, that.notes) &&
507509
Objects.equals(baseName, that.baseName) &&
@@ -547,7 +549,7 @@ public int hashCode() {
547549
returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap,
548550
isArray, isMultipart, isVoid, isResponseBinary, isResponseFile, isResponseOptional, hasReference,
549551
isDeprecated, isCallbackRequest, uniqueItems, path, operationId, returnType, httpMethod,
550-
returnBaseType, returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse,
552+
returnBaseType, returnContainer, summary, unescapedSummary, unescapedNotes, notes, baseName, defaultResponse,
551553
discriminator, consumes, produces, prioritizedContentTypes, servers, bodyParam, allParams, bodyParams,
552554
pathParams, queryParams, headerParams, formParams, cookieParams, requiredParams, returnProperty, optionalParams,
553555
authMethods, tags, responses, callbacks, imports, examples, requestBodyExamples, externalDocs,

modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
3333
public boolean is4xx;
3434
public boolean is5xx;
3535
public String message;
36+
public String unescapedMessage;
3637
public List<Map<String, Object>> examples;
3738
public String dataType;
3839
public String baseType;
@@ -109,7 +110,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
109110

110111
@Override
111112
public int hashCode() {
112-
return Objects.hash(headers, code, message, examples, dataType, baseType, containerType, containerTypeMapped, hasHeaders,
113+
return Objects.hash(headers, code, message, unescapedMessage, examples, dataType, baseType, containerType, containerTypeMapped, hasHeaders,
113114
isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBoolean, isDate,
114115
isDateTime, isUuid, isEmail, isPassword, isModel, isFreeFormObject, isAnyType, isDefault, simpleType, primitiveType,
115116
isMap, isOptional, isArray, isBinary, isFile, schema, jsonSchema, vendorExtensions, items, additionalProperties,
@@ -182,6 +183,7 @@ public boolean equals(Object o) {
182183
Objects.equals(headers, that.headers) &&
183184
Objects.equals(code, that.code) &&
184185
Objects.equals(message, that.message) &&
186+
Objects.equals(unescapedMessage, that.unescapedMessage) &&
185187
Objects.equals(examples, that.examples) &&
186188
Objects.equals(dataType, that.dataType) &&
187189
Objects.equals(baseType, that.baseType) &&
@@ -582,6 +584,7 @@ public String toString() {
582584
sb.append(", is4xx='").append(is4xx).append('\'');
583585
sb.append(", is5xx='").append(is5xx).append('\'');
584586
sb.append(", message='").append(message).append('\'');
587+
sb.append(", unescapedMessage='").append(unescapedMessage).append('\'');
585588
sb.append(", examples=").append(examples);
586589
sb.append(", dataType='").append(dataType).append('\'');
587590
sb.append(", baseType='").append(baseType).append('\'');

modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4675,6 +4675,7 @@ public CodegenOperation fromOperation(String path,
46754675
}
46764676

46774677
op.summary = escapeText(operation.getSummary());
4678+
op.unescapedSummary = operation.getSummary();
46784679
op.unescapedNotes = operation.getDescription();
46794680
op.notes = escapeText(operation.getDescription());
46804681
op.hasConsumes = false;
@@ -4839,6 +4840,7 @@ public CodegenOperation fromOperation(String path,
48394840

48404841
if (bodyParam != null) {
48414842
bodyParam.description = escapeText(requestBody.getDescription());
4843+
bodyParam.unescapedDescription = requestBody.getDescription();
48424844
postProcessParameter(bodyParam);
48434845
bodyParams.add(bodyParam);
48444846
if (prependFormOrBodyParameters) {
@@ -5029,6 +5031,7 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) {
50295031
}
50305032
r.schema = responseSchema;
50315033
r.message = escapeText(response.getDescription());
5034+
r.unescapedMessage = response.getDescription();
50325035

50335036
// adding examples to API responses
50345037
Map<String, Example> examples = ExamplesUtils.getExamplesFromResponse(openAPI, response);
@@ -7575,6 +7578,7 @@ protected void addBodyModelSchema(CodegenParameter codegenParameter, String name
75757578
codegenParameter.baseType = codegenModel.classname;
75767579
codegenParameter.dataType = getTypeDeclaration(codegenModel.classname);
75777580
codegenParameter.description = codegenModel.description;
7581+
codegenParameter.unescapedDescription = codegenModel.unescapedDescription;
75787582
codegenParameter.isNullable = codegenModel.isNullable;
75797583
imports.add(codegenParameter.baseType);
75807584
} else {
@@ -7948,6 +7952,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Set<String> imports, S
79487952
codegenParameter.baseName = "UNKNOWN_BASE_NAME";
79497953
codegenParameter.paramName = "UNKNOWN_PARAM_NAME";
79507954
codegenParameter.description = escapeText(body.getDescription());
7955+
codegenParameter.unescapedDescription = body.getDescription();
79517956
codegenParameter.required = body.getRequired() != null ? body.getRequired() : Boolean.FALSE;
79527957
codegenParameter.isBodyParam = Boolean.TRUE;
79537958
if (body.getExtensions() != null) {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) ({{{generatorVersion}}}).
3+
* https://openapi-generator.tech
4+
* Do not edit the class manually.
5+
*/

modules/openapi-generator/src/main/resources/kotlin-spring/service.mustache

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ interface {{classname}}Service {
1111
{{#operation}}
1212

1313
/**
14-
* {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}}
15-
{{#notes}}
16-
* {{.}}
17-
{{/notes}}
14+
* {{httpMethod}} {{{path}}}{{#unescapedSummary}} : {{{.}}}{{/unescapedSummary}}
15+
{{#unescapedNotes}}
16+
* {{{.}}}
17+
{{/unescapedNotes}}
1818
*
1919
{{#allParams}}
20-
* @param {{{paramName}}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
20+
* @param {{{paramName}}} {{{unescapedDescription}}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{^isString}}{{{.}}}{{/isString}}{{#isString}}{{#lambda.escapeDollar}}{{{.}}}{{/lambda.escapeDollar}}{{/isString}}{{/defaultValue}}){{/required}}
2121
{{/allParams}}
22-
* @return {{#responses}}{{message}} (status code {{code}}){{^-last}}
22+
* @return {{#responses}}{{{unescapedMessage}}} (status code {{code}}){{^-last}}
2323
* or {{/-last}}{{/responses}}
2424
{{#isDeprecated}}
2525
* @deprecated
2626
{{/isDeprecated}}
2727
{{#externalDocs}}
2828
* {{description}}
29-
* @see <a href="{{url}}">{{summary}} Documentation</a>
29+
* @see <a href="{{url}}">{{{summary}}} Documentation</a>
3030
{{/externalDocs}}
3131
* @see {{classname}}#{{operationId}}
3232
*/

samples/server/petstore/kotlin-springboot-3-dollar-issue-swagger2/src/main/kotlin/org/openapitools/api/ItemsApiService.kt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@ import org.openapitools.model.ItemsItemIdSomethingItemSubIdGet200Response
66
interface ItemsApiService {
77

88
/**
9-
* GET /items/{item$Id}/something/{item$SubId} : SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some
10-
* SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some
9+
* GET /items/{item$Id}/something/{item$SubId} : SQ = "; SBS = \; DBS = \\; SD = $some
10+
* SQ = "; SBS = \; DBS = \\; SD = $some
1111
*
12-
* @param itemDollarId SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some (required)
13-
* @param itemDollarSubId SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some (required)
14-
* @param filterDollarType SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some (optional, default to &quot;SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some&quot;)
15-
* @param filterDollarSubType SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some (optional, default to &quot;SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some&quot;)
16-
* @param xCustomHeader SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some (optional)
17-
* @param xCustomHeaderTwo SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some (optional)
18-
* @param sessionDollarToken SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some (optional)
19-
* @param sessionDollarTokenTwo SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some (optional)
20-
* @return SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some (status code 200)
12+
* @param itemDollarId SQ = "; SBS = \; DBS = \\; SD = $some (required)
13+
* @param itemDollarSubId SQ = "; SBS = \; DBS = \\; SD = $some (required)
14+
* @param filterDollarType SQ = "; SBS = \; DBS = \\; SD = $some (optional, default to "SQ = \"; SBS = \\; DBS = \\\\; SD = \$some")
15+
* @param filterDollarSubType SQ = "; SBS = \; DBS = \\; SD = $some (optional, default to "SQ = \"; SBS = \\; DBS = \\\\; SD = \$some")
16+
* @param xCustomHeader SQ = "; SBS = \; DBS = \\; SD = $some (optional)
17+
* @param xCustomHeaderTwo SQ = "; SBS = \; DBS = \\; SD = $some (optional)
18+
* @param sessionDollarToken SQ = "; SBS = \; DBS = \\; SD = $some (optional)
19+
* @param sessionDollarTokenTwo SQ = "; SBS = \; DBS = \\; SD = $some (optional)
20+
* @return SQ = "; SBS = \; DBS = \\; SD = $some (status code 200)
2121
* @see ItemsApi#itemsItemIdSomethingItemSubIdGet
2222
*/
2323
fun itemsItemIdSomethingItemSubIdGet(itemDollarId: kotlin.String, itemDollarSubId: kotlin.String, filterDollarType: kotlin.String, filterDollarSubType: kotlin.String, xCustomHeader: kotlin.String?, xCustomHeaderTwo: kotlin.String?, sessionDollarToken: kotlin.String?, sessionDollarTokenTwo: kotlin.String?): ItemsItemIdSomethingItemSubIdGet200Response
2424

2525
/**
26-
* POST /items : SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some
27-
* SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some
26+
* POST /items : SQ = "; SBS = \; DBS = \\; SD = $some
27+
* SQ = "; SBS = \; DBS = \\; SD = $some
2828
*
29-
* @param xPostHeader SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some (optional)
30-
* @param formDollarName SQ &#x3D; \\\&quot;; SBS &#x3D; \\\\; DBS &#x3D; \\\\\\\\; SD &#x3D; $some (optional)
31-
* @param formDollarValue SQ &#x3D; \\\&quot;; SBS &#x3D; \\\\; DBS &#x3D; \\\\\\\\; SD &#x3D; $some (optional, default to &quot;SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some&quot;)
32-
* @return SQ &#x3D; \&quot;; SBS &#x3D; \\; DBS &#x3D; \\\\; SD &#x3D; $some (status code 201)
29+
* @param xPostHeader SQ = "; SBS = \; DBS = \\; SD = $some (optional)
30+
* @param formDollarName SQ = \"; SBS = \\; DBS = \\\\; SD = $some (optional)
31+
* @param formDollarValue SQ = \"; SBS = \\; DBS = \\\\; SD = $some (optional, default to "SQ = \"; SBS = \\; DBS = \\\\; SD = \$some")
32+
* @return SQ = "; SBS = \; DBS = \\; SD = $some (status code 201)
3333
* @see ItemsApi#itemsPost
3434
*/
3535
fun itemsPost(xPostHeader: kotlin.String?, formDollarName: kotlin.String?, formDollarValue: kotlin.String): ItemWithDollarAttributesAndExamples

samples/server/petstore/kotlin-springboot-3-dollar-issue-swagger2/src/main/kotlin/org/openapitools/api/StoreApiService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface StoreApiService {
66

77
/**
88
* DELETE /store/order/{orderId} : Delete purchase order by ID
9-
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
9+
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
1010
*
1111
* @param orderId ID of the order that needs to be deleted (required)
1212
* @return Invalid ID supplied (status code 400)
@@ -26,7 +26,7 @@ interface StoreApiService {
2626

2727
/**
2828
* GET /store/order/{orderId} : Find purchase order by ID
29-
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generate exceptions
29+
* For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
3030
*
3131
* @param orderId ID of pet that needs to be fetched (required)
3232
* @return successful operation (status code 200)

samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/api/StoreApiService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface StoreApiService {
66

77
/**
88
* DELETE /store/order/{orderId} : Delete purchase order by ID
9-
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
9+
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
1010
*
1111
* @param orderId ID of the order that needs to be deleted (required)
1212
* @return Invalid ID supplied (status code 400)
@@ -26,7 +26,7 @@ interface StoreApiService {
2626

2727
/**
2828
* GET /store/order/{orderId} : Find purchase order by ID
29-
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generate exceptions
29+
* For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
3030
*
3131
* @param orderId ID of pet that needs to be fetched (required)
3232
* @return successful operation (status code 200)

samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/StoreApiService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface StoreApiService {
66

77
/**
88
* DELETE /store/order/{orderId} : Delete purchase order by ID
9-
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
9+
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
1010
*
1111
* @param orderId ID of the order that needs to be deleted (required)
1212
* @return Invalid ID supplied (status code 400)
@@ -26,7 +26,7 @@ interface StoreApiService {
2626

2727
/**
2828
* GET /store/order/{orderId} : Find purchase order by ID
29-
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generate exceptions
29+
* For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
3030
*
3131
* @param orderId ID of pet that needs to be fetched (required)
3232
* @return successful operation (status code 200)

samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/api/StoreApiService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface StoreApiService {
66

77
/**
88
* DELETE /store/order/{orderId} : Delete purchase order by ID
9-
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
9+
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
1010
*
1111
* @param orderId ID of the order that needs to be deleted (required)
1212
* @return Invalid ID supplied (status code 400)
@@ -26,7 +26,7 @@ interface StoreApiService {
2626

2727
/**
2828
* GET /store/order/{orderId} : Find purchase order by ID
29-
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generate exceptions
29+
* For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
3030
*
3131
* @param orderId ID of pet that needs to be fetched (required)
3232
* @return successful operation (status code 200)

0 commit comments

Comments
 (0)