Skip to content
Snippets Groups Projects
Commit b91572a3 authored by Yevhen Vydolob's avatar Yevhen Vydolob
Browse files

#14756 fix typescript dto generator


Signed-off-by: default avatarYevhen Vydolob <yvydolob@redhat.com>
parent 012519d0
No related branches found
No related tags found
No related merge requests found
......@@ -204,6 +204,7 @@
<goal>test</goal>
</goals>
<configuration>
<forkCount>0</forkCount>
<systemPropertyVariables>
<buildDirectory>${project.build.directory}</buildDirectory>
</systemPropertyVariables>
......
......@@ -121,6 +121,10 @@ describe("DTO serialization tests", () => {
expect(customDto.customMap["bar"].name).to.eql("foo");
});
it("check Serializable type", () => {
const customDto: che.plugin.typescript.MyDtoWithSerializable = {
};
});
});
......@@ -11,6 +11,7 @@
*/
package org.eclipse.che.plugin.typescript.dto;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
......@@ -139,6 +140,8 @@ public class DTOHelper {
return "number";
} else if (Boolean.class.equals(type) || Boolean.TYPE.equals(type)) {
return "boolean";
} else if (Serializable.class.equals(type)) {
return "string | number | boolean";
}
return type.getTypeName();
......@@ -210,6 +213,8 @@ public class DTOHelper {
return "number";
} else if (Boolean.class.equals(type) || Boolean.TYPE.equals(type)) {
return "boolean";
} else if (Serializable.class.equals(type)) {
return "string | number | boolean";
}
String declarationPackage = convertToDTSPackageName((Class) containerType);
......
/*
* Copyright (c) 2012-2018 Red Hat, Inc.
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.plugin.typescript.dto;
import java.io.Serializable;
import java.util.Map;
import org.eclipse.che.dto.shared.DTO;
@DTO
public interface MyDtoWithSerializableDTO {
Map<String, Serializable> getPreferences();
void setPreferences(Map<String, Serializable> preferences);
}
......@@ -12,6 +12,8 @@
set -e
set -u
rm -f ./index.d.ts
docker run -i --rm -v "$HOME/.m2:/root/.m2" \
-v "$(pwd)/dto-pom.xml:/usr/src/mymaven/pom.xml" \
-w /usr/src/mymaven maven:3.3-jdk-8 \
......
......@@ -17,6 +17,7 @@ import static org.eclipse.che.api.core.factory.FactoryParameter.Obligation.OPTIO
import java.util.Map;
import org.eclipse.che.api.core.factory.FactoryParameter;
import org.eclipse.che.api.core.model.workspace.config.Command;
import org.eclipse.che.api.workspace.shared.dto.devfile.PreviewUrlDto;
import org.eclipse.che.dto.shared.DTO;
/** @author Alexander Garagatyi */
......@@ -54,4 +55,11 @@ public interface CommandDto extends Command {
void setAttributes(Map<String, String> attributes);
CommandDto withAttributes(Map<String, String> attributes);
@Override
PreviewUrlDto getPreviewUrl();
void setPreviewUrl(PreviewUrlDto previewUrl);
CommandDto withPreviewUrl(PreviewUrlDto previewUrl);
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment