diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache index 7d7cec63425b..150fff84dbd6 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache @@ -23,7 +23,7 @@ import {{packageName}}.infrastructure.toMultiValue /** * {{summary}} * {{notes}} - {{#allParams}}* @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + {{#allParams}}* @param {{{paramName}}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}}* @return {{#returnType}}{{{returnType}}}{{#nullableReturnType}} or null{{/nullableReturnType}}{{/returnType}}{{^returnType}}void{{/returnType}} * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response @@ -31,34 +31,34 @@ import {{packageName}}.infrastructure.toMultiValue */{{#returnType}} @Suppress("UNCHECKED_CAST"){{/returnType}} @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} { - val localVariableBody: kotlin.Any? = {{#hasBodyParam}}{{#bodyParams}}{{paramName}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}null{{/hasFormParams}}{{#hasFormParams}}mapOf({{#formParams}}"{{{baseName}}}" to "${{paramName}}"{{#hasMore}}, {{/hasMore}}{{/formParams}}){{/hasFormParams}}{{/hasBodyParam}} + fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} { + val localVariableBody: kotlin.Any? = {{#hasBodyParam}}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}null{{/hasFormParams}}{{#hasFormParams}}mapOf({{#formParams}}"{{{baseName}}}" to "${{{paramName}}}"{{#hasMore}}, {{/hasMore}}{{/formParams}}){{/hasFormParams}}{{/hasBodyParam}} val localVariableQuery: MultiValueMap = {{^hasQueryParams}}mutableMapOf() {{/hasQueryParams}}{{#hasQueryParams}}mutableMapOf>() .apply { {{#queryParams}} {{^required}} - if ({{paramName}} != null) { - put("{{paramName}}", {{#isContainer}}toMultiValue({{paramName}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString({{paramName}}){{/isDateTime}}{{#isDate}}parseDateToQueryString({{paramName}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{paramName}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) + if ({{{paramName}}} != null) { + put("{{baseName}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) } {{/required}} {{#required}} {{#isNullable}} - if ({{paramName}} != null) { - put("{{paramName}}", {{#isContainer}}toMultiValue({{paramName}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString({{paramName}}){{/isDateTime}}{{#isDate}}parseDateToQueryString({{paramName}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{paramName}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) + if ({{{paramName}}} != null) { + put("{{baseName}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) } {{/isNullable}} {{^isNullable}} - put("{{paramName}}", {{#isContainer}}toMultiValue({{paramName}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString({{paramName}}){{/isDateTime}}{{#isDate}}parseDateToQueryString({{paramName}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{paramName}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) + put("{{baseName}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) {{/isNullable}} {{/required}} {{/queryParams}} } {{/hasQueryParams}} - val localVariableHeaders: MutableMap = mutableMapOf({{#hasFormParams}}"Content-Type" to {{^consumes}}"multipart/form-data"{{/consumes}}{{#consumes.0}}"{{MediaType}}"{{/consumes.0}}{{/hasFormParams}}{{^hasHeaderParams}}){{/hasHeaderParams}}{{#hasHeaderParams}}{{#hasFormParams}}, {{/hasFormParams}}{{#headerParams}}"{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}{{paramName}}.toString(){{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/headerParams}}){{/hasHeaderParams}} + val localVariableHeaders: MutableMap = mutableMapOf({{#hasFormParams}}"Content-Type" to {{^consumes}}"multipart/form-data"{{/consumes}}{{#consumes.0}}"{{MediaType}}"{{/consumes.0}}{{/hasFormParams}}{{^hasHeaderParams}}){{/hasHeaderParams}}{{#hasHeaderParams}}{{#hasFormParams}}, {{/hasFormParams}}{{#headerParams}}"{{baseName}}" to {{#isContainer}}{{{paramName}}}.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}{{{paramName}}}.toString(){{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/headerParams}}){{/hasHeaderParams}} val localVariableConfig = RequestConfig( RequestMethod.{{httpMethod}}, - "{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", "${{paramName}}"){{/pathParams}}, + "{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", "${{{paramName}}}"){{/pathParams}}, query = localVariableQuery, headers = localVariableHeaders ) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/bodyParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/bodyParams.mustache index 079fbb1169b5..7e7ea165b4a4 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@Body {{paramName}}: {{{dataType}}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}@Body {{{paramName}}}: {{{dataType}}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/formParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/formParams.mustache index 5a7f687061d0..2fc767cb2cfd 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{baseName}}") {{paramName}}: {{{dataType}}}{{/isFile}}{{#isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field("{{baseName}}"){{/isMultipart}} {{paramName}}: MultipartBody.Part {{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{baseName}}") {{{paramName}}}: {{{dataType}}}{{/isFile}}{{#isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field("{{baseName}}"){{/isMultipart}} {{{paramName}}}: MultipartBody.Part {{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/headerParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/headerParams.mustache index 2b26c446678c..aa5a8e346732 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@Header("{{baseName}}") {{paramName}}: {{{dataType}}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@Header("{{baseName}}") {{{paramName}}}: {{{dataType}}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/pathParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/pathParams.mustache index 996a45473a95..9712828b56cd 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}@Path("{{baseName}}") {{paramName}}: {{{dataType}}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}@Path("{{baseName}}") {{{paramName}}}: {{{dataType}}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/queryParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/queryParams.mustache index 14c40f05e588..b5bace590c56 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@Query("{{baseName}}") {{paramName}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}@Query("{{baseName}}") {{{paramName}}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache index e49cc83507b8..aac93219b677 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache @@ -33,30 +33,30 @@ import kotlinx.serialization.internal.StringDescriptor /** * {{summary}} * {{notes}} - {{#allParams}}* @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + {{#allParams}}* @param {{{paramName}}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}}* @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} */ {{#returnType}} @Suppress("UNCHECKED_CAST") {{/returnType}} - suspend fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : HttpResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> { + suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : HttpResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> { val localVariableAuthNames = listOf({{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}}) - val localVariableBody = {{#hasBodyParam}}{{#bodyParam}}{{#isListContainer}}{{operationIdCamelCase}}Request({{paramName}}.asList()){{/isListContainer}}{{^isListContainer}}{{#isMapContainer}}{{operationIdCamelCase}}Request({{paramName}}){{/isMapContainer}}{{^isMapContainer}}{{paramName}}{{/isMapContainer}}{{/isListContainer}}{{/bodyParam}}{{/hasBodyParam}} + val localVariableBody = {{#hasBodyParam}}{{#bodyParam}}{{#isListContainer}}{{operationIdCamelCase}}Request({{{paramName}}}.asList()){{/isListContainer}}{{^isListContainer}}{{#isMapContainer}}{{operationIdCamelCase}}Request({{{paramName}}}){{/isMapContainer}}{{^isMapContainer}}{{{paramName}}}{{/isMapContainer}}{{/isListContainer}}{{/bodyParam}}{{/hasBodyParam}} {{^hasBodyParam}} {{#hasFormParams}} {{#isMultipart}} formData { {{#formParams}} - {{paramName}}?.apply { append("{{{baseName}}}", {{paramName}}) } + {{{paramName}}}?.apply { append("{{{baseName}}}", {{{paramName}}}) } {{/formParams}} } {{/isMultipart}} {{^isMultipart}} ParametersBuilder().also { {{#formParams}} - {{paramName}}?.apply { it.append("{{{baseName}}}", {{paramName}}.toString()) } + {{{paramName}}}?.apply { it.append("{{{baseName}}}", {{{paramName}}}.toString()) } {{/formParams}} }.build() {{/isMultipart}} @@ -68,17 +68,17 @@ import kotlinx.serialization.internal.StringDescriptor val localVariableQuery = mutableMapOf>() {{#queryParams}} - {{paramName}}?.apply { localVariableQuery["{{baseName}}"] = {{#isContainer}}toMultiValue(this, "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf("${{paramName}}"){{/isContainer}} } + {{{paramName}}}?.apply { localVariableQuery["{{baseName}}"] = {{#isContainer}}toMultiValue(this, "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf("${{{paramName}}}"){{/isContainer}} } {{/queryParams}} val localVariableHeaders = mutableMapOf() {{#headerParams}} - {{paramName}}?.apply { localVariableHeaders["{{baseName}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} } + {{{paramName}}}?.apply { localVariableHeaders["{{baseName}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} } {{/headerParams}} val localVariableConfig = RequestConfig( RequestMethod.{{httpMethod}}, - "{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", "${{paramName}}"){{/pathParams}}, + "{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", "${{{paramName}}}"){{/pathParams}}, query = localVariableQuery, headers = localVariableHeaders ) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java new file mode 100644 index 000000000000..3a54bc8994aa --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinReservedWordsTest.java @@ -0,0 +1,128 @@ +package org.openapitools.codegen.kotlin; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.parameters.Parameter; +import org.openapitools.codegen.*; +import org.openapitools.codegen.languages.KotlinClientCodegen; +import org.openapitools.codegen.utils.StringUtils; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.util.HashSet; + +import static org.testng.Assert.assertEquals; + +@SuppressWarnings("rawtypes") +public class KotlinReservedWordsTest { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/kotlin/reserved_words.yaml"); + + @DataProvider(name = "reservedWords") + static Object[][] reservedWords() { + return new Object[][]{ + {"as"}, + {"break"}, + {"class"}, + {"continue"}, + {"do"}, + {"else"}, + {"false"}, + {"for"}, + {"fun"}, + {"if"}, + {"in"}, + {"interface"}, + {"is"}, + {"null"}, + {"object"}, + {"package"}, + {"return"}, + {"super"}, + {"this"}, + {"throw"}, + {"true"}, + {"try"}, + {"typealias"}, + {"typeof"}, + {"val"}, + {"var"}, + {"when"}, + {"while"} + }; + } + + @Test(dataProvider = "reservedWords") + public void testReservedWordsAsModels(String reservedWord) { + final DefaultCodegen codegen = new KotlinClientCodegen(); + final Schema schema = new Schema(); + final String escaped = "`" + reservedWord + "`"; + final String titleCased = StringUtils.camelize(reservedWord, false); + + codegen.setOpenAPI(openAPI); + CodegenModel model = codegen.fromModel(reservedWord, schema); + + assertEquals(model.classname, titleCased); + if ("class".equals(reservedWord)) { + // this is a really weird "edge" case rename. + assertEquals(model.classVarName, "propertyClass"); + } else { + assertEquals(model.classVarName, escaped); + } + assertEquals(model.name, escaped); + assertEquals(model.classFilename, titleCased); + } + + @SuppressWarnings("OptionalGetWithoutIsPresent") + @Test(dataProvider = "reservedWords") + public void testReservedWordsAsParameters(String reservedWord) { + final DefaultCodegen codegen = new KotlinClientCodegen(); + final String escaped = "`" + reservedWord + "`"; + codegen.setOpenAPI(openAPI); + Operation operation = openAPI.getPaths().get("/ping").getGet(); + + Parameter current = operation.getParameters().stream().filter(x -> reservedWord.equals(x.getName())).findFirst().get(); + CodegenParameter codegenParameter = codegen.fromParameter(current, new HashSet<>()); + + assertEquals(current.getName(), reservedWord); + if ("class".equals(reservedWord)) { + assertEquals(codegenParameter.paramName, "propertyClass"); + } else { + assertEquals(codegenParameter.paramName, escaped); + } + } + + @Test(dataProvider = "reservedWords") + public void testReservedWordsAsProperties(String reservedWord) { + final DefaultCodegen codegen = new KotlinClientCodegen(); + + final String escaped = "`" + reservedWord + "`"; + final String titleCased = StringUtils.camelize(reservedWord, false); + + Schema linked = openAPI.getComponents().getSchemas().get("Linked"); + + CodegenProperty property = codegen.fromProperty(reservedWord, (Schema) linked.getProperties().get(reservedWord)); + + if ("object".equals(reservedWord)) { + assertEquals(property.complexType, "kotlin.Any"); + assertEquals(property.dataType, "kotlin.Any"); + assertEquals(property.datatypeWithEnum, "kotlin.Any"); + assertEquals(property.baseType, "kotlin.Any"); + } else { + assertEquals(property.complexType, titleCased); + assertEquals(property.dataType, titleCased); + assertEquals(property.datatypeWithEnum, titleCased); + assertEquals(property.baseType, titleCased); + } + + if ("class".equals(reservedWord)) { + // this is a really weird "edge" case rename. + assertEquals(property.name, "propertyClass"); + } else { + assertEquals(property.name, escaped); + } + + assertEquals(property.baseName, reservedWord); + } + +} diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/reserved_words.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/reserved_words.yaml new file mode 100644 index 000000000000..c4022711783c --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/reserved_words.yaml @@ -0,0 +1,475 @@ +openapi: 3.0.1 +info: + title: Test for Kotlin reserved words + version: 1.0.0 +paths: + /ping: + get: + summary: Ping + description: Pingy Ping + parameters: + - name: as + in: header + schema: + type: string + - name: break + in: header + schema: + type: string + - name: class + in: header + schema: + type: string + - name: continue + in: header + schema: + type: string + - name: do + in: header + schema: + type: string + - name: else + in: header + schema: + type: string + - name: "false" + in: header + schema: + type: string + - name: for + in: header + schema: + type: string + - name: fun + in: header + schema: + type: string + - name: if + in: header + schema: + type: string + - name: in + in: header + schema: + type: string + - name: interface + in: header + schema: + type: string + - name: is + in: header + schema: + type: string + - name: "null" + in: header + schema: + type: string + - name: object + in: header + schema: + type: string + - name: package + in: header + schema: + type: string + - name: return + in: header + schema: + type: string + - name: super + in: header + schema: + type: string + - name: this + in: header + schema: + type: string + - name: throw + in: header + schema: + type: string + - name: "true" + in: header + schema: + type: string + - name: try + in: header + schema: + type: string + - name: typealias + in: header + schema: + type: string + - name: typeof + in: header + schema: + type: string + - name: val + in: header + schema: + type: string + - name: var + in: header + schema: + type: string + - name: when + in: header + schema: + type: string + - name: while + in: header + schema: + type: string + responses: + '200': + $ref: "#/components/schemas/Good" + +components: + schemas: + Good: + description: OK, Good + type: object + properties: + as: + type: string + break: + type: string + class: + type: string + continue: + type: string + do: + type: string + else: + type: string + false: + type: string + for: + type: string + fun: + type: string + if: + type: string + in: + type: string + interface: + type: string + is: + type: string + null: + type: string + object: + type: string + package: + type: string + return: + type: string + super: + type: string + this: + type: string + throw: + type: string + true: + type: string + try: + type: string + typealias: + type: string + typeof: + type: string + val: + type: string + var: + type: string + when: + type: string + while: + type: string + linked: + $ref: '#/components/schemas/Linked' + + Linked: + description: Refernce links + type: object + properties: + as: + $ref: '#/components/schemas/as' + break: + $ref: '#/components/schemas/break' + class: + $ref: '#/components/schemas/class' + continue: + $ref: '#/components/schemas/continue' + do: + $ref: '#/components/schemas/do' + else: + $ref: '#/components/schemas/else' + false: + $ref: '#/components/schemas/false' + for: + $ref: '#/components/schemas/for' + fun: + $ref: '#/components/schemas/fun' + if: + $ref: '#/components/schemas/if' + in: + $ref: '#/components/schemas/in' + interface: + $ref: '#/components/schemas/interface' + is: + $ref: '#/components/schemas/is' + null: + $ref: '#/components/schemas/null' + object: + $ref: '#/components/schemas/object' + package: + $ref: '#/components/schemas/package' + return: + $ref: '#/components/schemas/return' + super: + $ref: '#/components/schemas/super' + this: + $ref: '#/components/schemas/this' + throw: + $ref: '#/components/schemas/throw' + true: + $ref: '#/components/schemas/true' + try: + $ref: '#/components/schemas/try' + typealias: + $ref: '#/components/schemas/typealias' + typeof: + $ref: '#/components/schemas/typeof' + val: + $ref: '#/components/schemas/val' + var: + $ref: '#/components/schemas/var' + when: + $ref: '#/components/schemas/when' + while: + $ref: '#/components/schemas/while' + + as: + title: Testing reserved word 'as' + type: object + properties: + id: + type: integer + format: int64 + + break: + title: Testing reserved word 'break' + type: object + properties: + id: + type: integer + format: int64 + + class: + title: Testing reserved word 'class' + type: object + properties: + id: + type: integer + format: int64 + + continue: + title: Testing reserved word 'continue' + type: object + properties: + id: + type: integer + format: int64 + + do: + title: Testing reserved word 'do' + type: object + properties: + id: + type: integer + format: int64 + + else: + title: Testing reserved word 'else' + type: object + properties: + id: + type: integer + format: int64 + + false: + title: Testing reserved word 'false' + type: object + properties: + id: + type: integer + format: int64 + + for: + title: Testing reserved word 'for' + type: object + properties: + id: + type: integer + format: int64 + + fun: + title: Testing reserved word 'fun' + type: object + properties: + id: + type: integer + format: int64 + + if: + title: Testing reserved word 'if' + type: object + properties: + id: + type: integer + format: int64 + + in: + title: Testing reserved word 'in' + type: object + properties: + id: + type: integer + format: int64 + + interface: + title: Testing reserved word 'interface' + type: object + properties: + id: + type: integer + format: int64 + + is: + title: Testing reserved word 'is' + type: object + properties: + id: + type: integer + format: int64 + + null: + title: Testing reserved word 'null' + type: object + properties: + id: + type: integer + format: int64 + + object: + title: Testing reserved word 'object' + type: object + properties: + id: + type: integer + format: int64 + + package: + title: Testing reserved word 'package' + type: object + properties: + id: + type: integer + format: int64 + + return: + title: Testing reserved word 'return' + type: object + properties: + id: + type: integer + format: int64 + + super: + title: Testing reserved word 'super' + type: object + properties: + id: + type: integer + format: int64 + + this: + title: Testing reserved word 'this' + type: object + properties: + id: + type: integer + format: int64 + + throw: + title: Testing reserved word 'throw' + type: object + properties: + id: + type: integer + format: int64 + + true: + title: Testing reserved word 'true' + type: object + properties: + id: + type: integer + format: int64 + + try: + title: Testing reserved word 'try' + type: object + properties: + id: + type: integer + format: int64 + + typealias: + title: Testing reserved word 'typealias' + type: object + properties: + id: + type: integer + format: int64 + + typeof: + title: Testing reserved word 'typeof' + type: object + properties: + id: + type: integer + format: int64 + + val: + title: Testing reserved word 'val' + type: object + properties: + id: + type: integer + format: int64 + + var: + title: Testing reserved word 'var' + type: object + properties: + id: + type: integer + format: int64 + + when: + title: Testing reserved word 'when' + type: object + properties: + id: + type: integer + format: int64 + + while: + title: Testing reserved word 'while' + type: object + properties: + id: + type: integer + format: int64 \ No newline at end of file