typescript-generator | Generates TypeScript from Java - JSON declarations | Plugin library
kandi X-RAY | typescript-generator Summary
kandi X-RAY | typescript-generator Summary
Generates TypeScript from Java - JSON declarations, REST service client
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Validates the implementation .
- Processes the given java type .
- Parse a resource method .
- Process a REST method .
- Parses a controller method .
- Transforms a ts type .
- Get the copy function for a tsType .
- Processes the bean property .
- Parses the queue .
- Returns the fully qualified name of a class .
typescript-generator Key Features
typescript-generator Examples and Code Snippets
Community Discussions
Trending Discussions on typescript-generator
QUESTION
I'm having a problem with the habarta typescript generator, tried all versions from 2.7. to latest. Here's the gradle buildscript
...ANSWER
Answered 2019-Mar-02 at 12:57So, the answer seems to be you have a dependency on that ReactiveMongoRepository
interface.
Trying out your project setup, without depending on ReactiveMongoRepository
, running the generateTypeScript
gives a clean build.
However when depending on that interface, the error matches what you posted (see below).
Extending the ReactiveMongoRepository
and then marking it as excluded does not work, and is a bit non-sense, if that is the case.
QUESTION
I googled as best as I could anad found things like this: https://www.typescriptlang.org/docs/handbook/enums.html, but no answer to my specific question.
I have an enum that is being generated by typescript-generator. Here is the enum:
...ANSWER
Answered 2018-Nov-05 at 20:42Answer was simply:
QUESTION
I'm using Kotlin with https://github.com/vojtechhabarta/typescript-generator to generate TypeScript definitions for my classes that are used in an API.
To preserve nullability information, typescript-generator can use annotations present on fields and methods. It supports arbitrary annotation class names, listed in the build script.
Kotlin, for some reason, annotates nullable fields with @org.jetbrains.annotations.Nullable
rather than the JSR-305 annotation, @javax.annotation.Nullable
.
While the JSR-305 annotation has RetentionPolicy.RUNTIME
, the Jetbrains annotation has RetentionPolicy.CLASS
, making it unsuitable for introspection by libraries which use Java Reflection to detect annotations.
Is it possible to have Kotlin generate standards-based annotations instead of the JetBrains proprietary annotations?
If not, I'm interested in simple solutions to handle the issue. Perhaps a Gradle plugin that can generate JSR-305 annotations from the JetBrains ones or similar. I would really prefer to not have to double-annotate everything with a ?
and @Nullable
.
ANSWER
Answered 2017-Sep-16 at 09:49Kotlin is designed to emit its own (JetBrains) annotations. This choise was made because JSR 305 was never released and there is no legal way for JetBrains to bundle JSR 305 annotations with compiler, since the license on (a dormant) JSR 305 does not allow it. The legal status of the com.google.code.findbugs:jsr305
maven artifact is likewise murky, since javax
package namespace is specifically reserved for JSRs.
There are the following possible solutions:
Write a custom Gradle plugin that post-processes Kotlin-compiled class files and changes
org.jetbrains.annotations.*
annotations to the correspondingjavax.annotation.*
annotations (NotNull
toNonnull
andNullable
toNullable
) and changes the corresponding attiributes from runtime-invisible annotations to runtime-visible ones.Patch
typescript-generator
so that it used Kotlin reflection APIs in addition to Java Reflection to get nullablitity information from Kotlin classes. The entry point is for this task is kotlin extension of JavaClass
instance that allows to retrieve all the Kotlin metadata.Add
jackson-module-kotlin
totypescript-generator
. This module is using Kotlin's reflection to get all the Kotlin specific information and feed it to Jackson, whiletypescript-generator
is using Jackson bean introspection to get its type information, so it might just work.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install typescript-generator
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page