[bug][kotlin] Fix compile of reserved word in client (#5221)

* [kotlin] Fix compile of reserved word in client

A number of places in the client code need to be escaped for reserved
words.

That is, this should be:
(git log formatted): `as` rather than as
(markdown formatted): \`as\` rather than `as`

There are only a handful of places using `{{paramName}}` which HTML
encodes backticks, rather than `{{{paramName}}}` which outputs literal
values.

Added unit test to maintain the reserved word standard for Kotlin.

* don't use kotlin-codegen-escaped parameters in parameter-map

Co-authored-by: Andreas Müller <andreas@stapelspeicher.org>
This commit is contained in:
Jim Schubert
2020-02-06 00:49:52 -05:00
committed by GitHub
parent 9d2c39dc43
commit 4fa096f604
9 changed files with 626 additions and 23 deletions

View File

@@ -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<kotlin.String, List<kotlin.String>>()
.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<String, String> = 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<String, String> = 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
)

View File

@@ -1 +1 @@
{{#isBodyParam}}@Body {{paramName}}: {{{dataType}}}{{/isBodyParam}}
{{#isBodyParam}}@Body {{{paramName}}}: {{{dataType}}}{{/isBodyParam}}

View File

@@ -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}}
{{#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}}

View File

@@ -1 +1 @@
{{#isHeaderParam}}@Header("{{baseName}}") {{paramName}}: {{{dataType}}}{{/isHeaderParam}}
{{#isHeaderParam}}@Header("{{baseName}}") {{{paramName}}}: {{{dataType}}}{{/isHeaderParam}}

View File

@@ -1 +1 @@
{{#isPathParam}}@Path("{{baseName}}") {{paramName}}: {{{dataType}}}{{/isPathParam}}
{{#isPathParam}}@Path("{{baseName}}") {{{paramName}}}: {{{dataType}}}{{/isPathParam}}

View File

@@ -1 +1 @@
{{#isQueryParam}}@Query("{{baseName}}") {{paramName}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}}{{/isQueryParam}}
{{#isQueryParam}}@Query("{{baseName}}") {{{paramName}}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}}{{/isQueryParam}}

View File

@@ -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<String>({{#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<String, List<String>>()
{{#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<String, String>()
{{#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
)

View File

@@ -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);
}
}

View File

@@ -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