Skip to content

Commit e9c6d65

Browse files
Updated keywords to be aligned with website https://developer.salesfo… (#7522)
* Updated keywords to be aligned with website https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_reserved_words.htm * [samples] Regenerate Co-authored-by: Jim Schubert <[email protected]>
1 parent 8c17a01 commit e9c6d65

File tree

3 files changed

+24
-50
lines changed

3 files changed

+24
-50
lines changed

docs/generators/apex.md

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
6464
<li>begin</li>
6565
<li>bigdecimal</li>
6666
<li>blob</li>
67+
<li>boolean</li>
6768
<li>break</li>
6869
<li>bulk</li>
6970
<li>by</li>
@@ -77,7 +78,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
7778
<li>commit</li>
7879
<li>const</li>
7980
<li>continue</li>
80-
<li>convertcurrency</li>
8181
<li>currency</li>
8282
<li>date</li>
8383
<li>datetime</li>
@@ -86,6 +86,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
8686
<li>delete</li>
8787
<li>desc</li>
8888
<li>do</li>
89+
<li>double</li>
8990
<li>else</li>
9091
<li>end</li>
9192
<li>enum</li>
@@ -99,7 +100,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
99100
<li>float</li>
100101
<li>for</li>
101102
<li>from</li>
102-
<li>future</li>
103103
<li>global</li>
104104
<li>goto</li>
105105
<li>group</li>
@@ -113,13 +113,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl
113113
<li>insert</li>
114114
<li>instanceof</li>
115115
<li>int</li>
116+
<li>integer</li>
116117
<li>interface</li>
117118
<li>into</li>
118119
<li>join</li>
119-
<li>last_90_days</li>
120-
<li>last_month</li>
121-
<li>last_n_days</li>
122-
<li>last_week</li>
123120
<li>like</li>
124121
<li>limit</li>
125122
<li>list</li>
@@ -128,10 +125,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
128125
<li>map</li>
129126
<li>merge</li>
130127
<li>new</li>
131-
<li>next_90_days</li>
132-
<li>next_month</li>
133-
<li>next_n_days</li>
134-
<li>next_week</li>
135128
<li>not</li>
136129
<li>null</li>
137130
<li>nulls</li>
@@ -150,45 +143,37 @@ These options may be applied as additional-properties (cli) or configOptions (pl
150143
<li>public</li>
151144
<li>retrieve</li>
152145
<li>return</li>
153-
<li>returning</li>
154146
<li>rollback</li>
155-
<li>savepoint</li>
156-
<li>search</li>
157147
<li>select</li>
158148
<li>set</li>
159149
<li>short</li>
150+
<li>sobject</li>
160151
<li>sort</li>
161-
<li>stat</li>
162152
<li>static</li>
153+
<li>string</li>
163154
<li>super</li>
164155
<li>switch</li>
165156
<li>synchronized</li>
166157
<li>system</li>
167158
<li>testmethod</li>
168159
<li>then</li>
169160
<li>this</li>
170-
<li>this_month</li>
171-
<li>this_week</li>
172161
<li>throw</li>
173162
<li>time</li>
174-
<li>today</li>
175-
<li>tolabel</li>
176-
<li>tomorrow</li>
177163
<li>transaction</li>
178164
<li>trigger</li>
179165
<li>true</li>
180166
<li>try</li>
181-
<li>type</li>
182167
<li>undelete</li>
183168
<li>update</li>
184169
<li>upsert</li>
185170
<li>using</li>
186171
<li>virtual</li>
172+
<li>void</li>
187173
<li>webservice</li>
188174
<li>when</li>
189175
<li>where</li>
190176
<li>while</li>
191-
<li>yesterday</li>
192177
</ul>
193178

194179
## FEATURE SET

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

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,22 +98,19 @@ public ApexClientCodegen() {
9898
// https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_reserved_words.htm
9999
setReservedWordsLowerCase(
100100
Arrays.asList("abstract", "activate", "and", "any", "array", "as", "asc", "autonomous",
101-
"begin", "bigdecimal", "blob", "break", "bulk", "by", "byte", "case", "cast",
101+
"begin", "bigdecimal", "blob", "boolean", "break", "bulk", "by", "byte", "case", "cast",
102102
"catch", "char", "class", "collect", "commit", "const", "continue",
103-
"convertcurrency", "currency", "date", "datetime", "decimal", "default", "delete", "desc", "do", "else",
103+
"currency", "date", "datetime", "decimal", "default", "delete", "desc", "do", "double", "else",
104104
"end", "enum", "exception", "exit", "export", "extends", "false", "final",
105-
"finally", "float", "for", "from", "future", "global", "goto", "group", "having",
106-
"hint", "if", "implements", "import", "in", "inner", "insert", "instanceof", "int",
107-
"interface", "into", "join", "last_90_days", "last_month", "last_n_days",
108-
"last_week", "like", "limit", "list", "long", "loop", "map", "merge", "new",
109-
"next_90_days", "next_month", "next_n_days", "next_week", "not", "null", "nulls",
110-
"number", "object", "of", "on", "or", "outer", "override", "package", "parallel",
111-
"pragma", "private", "protected", "public", "retrieve", "return", "returning",
112-
"rollback", "savepoint", "search", "select", "set", "short", "sort", "stat",
113-
"static", "super", "switch", "synchronized", "system", "testmethod", "then", "this",
114-
"this_month", "this_week", "throw", "time", "today", "tolabel", "tomorrow", "transaction",
115-
"trigger", "true", "try", "type", "undelete", "update", "upsert", "using",
116-
"virtual", "webservice", "when", "where", "while", "yesterday"
105+
"finally", "float", "for", "from", "global", "goto", "group", "having",
106+
"hint", "if", "implements", "import", "in", "inner", "insert", "instanceof", "int", "integer",
107+
"interface", "into", "join", "like", "limit", "list", "long", "loop", "map", "merge", "new",
108+
"not", "null", "nulls", "number", "object", "of", "on", "or", "outer", "override", "package", "parallel",
109+
"pragma", "private", "protected", "public", "retrieve", "return",
110+
"rollback", "select", "set", "short", "sObject", "sort", "static", "string",
111+
"super", "switch", "synchronized", "system", "testmethod", "then", "this",
112+
"throw", "time", "transaction", "trigger", "true", "try", "undelete", "update", "upsert", "using",
113+
"virtual", "void", "webservice", "when", "where", "while"
117114
));
118115

119116
languageSpecificPrimitives = new HashSet<String>(

samples/client/petstore/apex/force-app/main/default/classes/OASApiResponse.cls

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,29 @@
1313
/**
1414
* Describes the result of uploading an image resource
1515
*/
16-
public class OASApiResponse implements OAS.MappedProperties {
16+
public class OASApiResponse {
1717
/**
1818
* Get code
1919
* @return code
2020
*/
2121
public Integer code { get; set; }
2222

2323
/**
24-
* Get r_type
25-
* @return r_type
24+
* Get type
25+
* @return type
2626
*/
27-
public String r_type { get; set; }
27+
public String type { get; set; }
2828

2929
/**
3030
* Get message
3131
* @return message
3232
*/
3333
public String message { get; set; }
3434

35-
private static final Map<String, String> propertyMappings = new Map<String, String>{
36-
'type' => 'r_type'
37-
};
38-
39-
public Map<String, String> getPropertyMappings() {
40-
return propertyMappings;
41-
}
42-
4335
public static OASApiResponse getExample() {
4436
OASApiResponse apiResponse = new OASApiResponse();
4537
apiResponse.code = 0;
46-
apiResponse.r_type = '';
38+
apiResponse.type = '';
4739
apiResponse.message = '';
4840
return apiResponse;
4941
}
@@ -52,7 +44,7 @@ public class OASApiResponse implements OAS.MappedProperties {
5244
if (obj instanceof OASApiResponse) {
5345
OASApiResponse apiResponse = (OASApiResponse) obj;
5446
return this.code == apiResponse.code
55-
&& this.r_type == apiResponse.r_type
47+
&& this.type == apiResponse.type
5648
&& this.message == apiResponse.message;
5749
}
5850
return false;
@@ -61,7 +53,7 @@ public class OASApiResponse implements OAS.MappedProperties {
6153
public Integer hashCode() {
6254
Integer hashCode = 43;
6355
hashCode = (17 * hashCode) + (code == null ? 0 : System.hashCode(code));
64-
hashCode = (17 * hashCode) + (r_type == null ? 0 : System.hashCode(r_type));
56+
hashCode = (17 * hashCode) + (type == null ? 0 : System.hashCode(type));
6557
hashCode = (17 * hashCode) + (message == null ? 0 : System.hashCode(message));
6658
return hashCode;
6759
}

0 commit comments

Comments
 (0)