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

Please clarify compatibility with Java 17 #1049

Open
serv-inc opened this issue Dec 5, 2023 · 4 comments
Open

Please clarify compatibility with Java 17 #1049

serv-inc opened this issue Dec 5, 2023 · 4 comments

Comments

@serv-inc
Copy link

serv-inc commented Dec 5, 2023

A friend mentioned that Java 17 no longer offers the API to be able to generate a typescript model. Is this correct, or does this project still work on Java 17 and above ?

@alebo611
Copy link

I can confirm that I am using Java 17 successfully with this plugin

@ccschneidr
Copy link

I cannot confirm that. typescript-generator requires the output of the javadoc xml doclet, which ist not compatible with JDK >= 11. Even a fork of it is not compatible with JDK >= 13. So, I could not find a solution for JDK 17 😭

@ccschneidr
Copy link

Aha! A colleague brought up the idea to work without JavaDoc xml file. Comments are missing in that case, but it's better than nothing. So, yes, typescript generator can run with JDK 17, but javadoc xml is not available in that case.

@sh-cho
Copy link

sh-cho commented Nov 30, 2024

Hi, I made this xml-doclet-v2 which uses new Java Doclet API, and with this you can generate Javadoc as XML on Java 11 and above.

e.g.

/**
 * This is class
 */
public class Foo {

    /**
     * This is field
     */
    public Long bar;
}

With xml-doclet-v2, it generates Javadoc xml like below,

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <package name="io.github.shcho">
        <class name="Foo" qualified="io.github.shcho">
            <comment>This is class</comment>
            <field name="bar">
                <comment>This is field</comment>
            </field>
        </class>
    </package>
</root>

And if you generate typescript with Javadoc xml, it generates ts file like below

/**
 * This is class
 */
interface Foo {
    /**
     * This is field
     */
    bar: number;
}

It is published on JitPack (https://jitpack.io/#sh-cho/xml-doclet-v2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants