typescript-generator icon indicating copy to clipboard operation
typescript-generator copied to clipboard

broken generated files.

Open scratchy opened this issue 2 years ago • 0 comments

Hello,

trieing to generate files for https://github.com/seancfoley/IPAddress

git clone the ip library -> adding a pom with

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.test</groupId>
    <artifactId>test</artifactId>
    <version>0.1</version>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>cz.habarta.typescript-generator</groupId>
                <artifactId>typescript-generator-maven-plugin</artifactId>
                <version>2.36.1070</version>
                <executions>
                    <execution>
                        <id>generate</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <phase>process-classes</phase>
                    </execution>
                </executions>
                <configuration>
                    <jsonLibrary>jackson2</jsonLibrary>
                    <classPatterns>inet.ipaddr.*</classPatterns>
                    <outputKind>module</outputKind>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

running mvn process-classes output is a not compileable test.d.ts. It complains about

TS2320: Interface 'IPAddress' cannot simultaneously extend types 'Address' and 'IPAddressRange'.   Named property 'lower' of types 'Address' and 'IPAddressRange' are not identical.

any fix / workaround?

scratchy avatar May 20 '22 12:05 scratchy