diff --git a/gradle.properties b/gradle.properties index f461d9d..f0661cb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ guavaVersion=18.0 feignVersion=8.10.0 jacksonVersion=2.6.1 jaxRsVersion=2.0.1 -typescriptGeneratorVersion=1.7.190 +typescriptGeneratorVersion=1.25.322 commonsIOVersion=2.4 findbugsAnnotationsVersion=3.0.0 diff --git a/typescript-service-generator-core/src/main/java/com/palantir/code/ts/generator/TypescriptServiceGeneratorConfiguration.java b/typescript-service-generator-core/src/main/java/com/palantir/code/ts/generator/TypescriptServiceGeneratorConfiguration.java index 15f2d7c..bc46d5d 100644 --- a/typescript-service-generator-core/src/main/java/com/palantir/code/ts/generator/TypescriptServiceGeneratorConfiguration.java +++ b/typescript-service-generator-core/src/main/java/com/palantir/code/ts/generator/TypescriptServiceGeneratorConfiguration.java @@ -213,6 +213,8 @@ public Settings getSettings() { settings.addTypeNamePrefix = generatedInterfacePrefix(); settings.sortDeclarations = true; settings.noFileComment = true; + // behave like 0.9.0; also fixes when subtypes use generics + settings.disableTaggedUnions = true; settings.jsonLibrary = JsonLibrary.jackson2; settings.optionalAnnotations = optionalAnnotations(); settings.outputKind = TypeScriptOutputKind.global; diff --git a/typescript-service-generator-core/src/test/java/com/palantir/code/ts/generator/ServiceEmitterTest.java b/typescript-service-generator-core/src/test/java/com/palantir/code/ts/generator/ServiceEmitterTest.java index 8413444..f5c730c 100644 --- a/typescript-service-generator-core/src/test/java/com/palantir/code/ts/generator/ServiceEmitterTest.java +++ b/typescript-service-generator-core/src/test/java/com/palantir/code/ts/generator/ServiceEmitterTest.java @@ -68,7 +68,7 @@ public void testComplexServiceClassEmitTypes() { "\n" + " export interface MyObject {\n" + " y: MyObject;\n" + -" }\n" + +" }\n\n\n // Added by 'EnumConstantsExtension' extension\n" + ""; assertEquals(expectedOutput, new String(stream.toByteArray())); } @@ -232,7 +232,7 @@ public void testAdditionalClassesToOutput() { String expectedOutput = "\n" + " export interface MyObject {\n" + " y: MyObject;\n" + -" }\n"; +" }\n\n\n // Added by 'EnumConstantsExtension' extension\n"; assertEquals(expectedOutput, new String(stream.toByteArray())); } @@ -244,7 +244,7 @@ public void testEnumClass() { writer.close(); String expectedOutput = "\n" + " export type MyEnum = \"VALUE1\" | \"VALUE2\";\n" + -"\n" + +"\n\n // Added by 'EnumConstantsExtension' extension\n\n" + " export const MyEnum = {\n" + " VALUE1: \"VALUE1\",\n" + " VALUE2: \"VALUE2\",\n" + diff --git a/typescript-service-generator-core/src/test/resources/eteTestData/complexServiceTestOutput/testComplexServiceClass.ts b/typescript-service-generator-core/src/test/resources/eteTestData/complexServiceTestOutput/testComplexServiceClass.ts index deec0cf..9c28440 100644 --- a/typescript-service-generator-core/src/test/resources/eteTestData/complexServiceTestOutput/testComplexServiceClass.ts +++ b/typescript-service-generator-core/src/test/resources/eteTestData/complexServiceTestOutput/testComplexServiceClass.ts @@ -18,6 +18,9 @@ module ModuleName.TestComplexServiceClass { y: IMyObject; } + + // Added by 'EnumConstantsExtension' extension + export interface ITestComplexServiceClass { allOptionsPost(a: string, dataObject: IDataObject, b?: number): FooReturn>; queryGetter(x?: boolean): FooReturn; diff --git a/typescript-service-generator-core/src/test/resources/eteTestData/simpleServiceTestOutput/simpleService1.ts b/typescript-service-generator-core/src/test/resources/eteTestData/simpleServiceTestOutput/simpleService1.ts index ec52223..d40160c 100644 --- a/typescript-service-generator-core/src/test/resources/eteTestData/simpleServiceTestOutput/simpleService1.ts +++ b/typescript-service-generator-core/src/test/resources/eteTestData/simpleServiceTestOutput/simpleService1.ts @@ -2,6 +2,9 @@ // Generated import { HttpEndpointOptions, HttpApiBridge } from "./httpApiBridge"; + +// Added by 'EnumConstantsExtension' extension + export interface SimpleService1 { method1(): FooReturn; }