Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTO TypeScript generator: Some DTO in Che are using "arguments" and this is a reserved keyword #6349

Merged
merged 1 commit into from
Sep 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ public static boolean isDtoWith(Method method) {
public static String getFieldName(String type) {
char[] c = type.toCharArray();
c[0] = Character.toLowerCase(c[0]);
return new String(c);

String val = new String(c);

// replace reserved keyword
if ("arguments".equals(val)) {
val = "argumentsObj";
}
return val;
}

/** Extract field name from the getter method */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/
package org.eclipse.che.plugin.typescript.dto;

import java.util.List;
import java.util.Map;
import org.eclipse.che.dto.shared.DTO;

Expand Down Expand Up @@ -40,4 +41,11 @@ public interface MyCustomDTO {
void setCustomMap(Map<String, MyOtherDTO> map);

MyCustomDTO withCustomMap(Map<String, MyOtherDTO> map);

// arguments is a reserved keyword for TypeScript
List<MyOtherDTO> getArguments();

void setArguments(List<MyOtherDTO> arguments);

MyCustomDTO withArguments(List<MyOtherDTO> arguments);
}