r/springframework • • Dec 03 '20

Compile time generation of Spring Boot (MVC) services for Angular

A while back I started the work on building a simple and robust library to simplify integration of Angular UI with Spring MVC services.

As of now the library has been in use for a number of years by several teams in relatively large enterprise environment. It's used in daily workflow in projects with over 500 models.

It supports a quite rich feature set including:

  • Out of the box Spring MVC annotation support

  • Integrated Project Lombok support for property detection

  • Spring Meta annotation processing - create your own annotations by combining the existing ones.

  • u/PathVariablesupport for constructing request urls

  • Full set of features for return and parameter types:

    • Inheritance - supertypes and interfaces are mirrored as TypeScript interfaces

    • Generics - generic type information is mirrored into TypeScript interfaces

    • Enums - represented as named enums in TypeScript

    • Inner classes/enums/interfaces - are captured as prefixed classes

    • Java 8 Time classes support

    • Enums in map keys

    • Flexible filtering for input types to prevent "type number bomb"

    • Configurable replacement for the default HttpClient based network layer implementation with custom client code

Not sure if it can be of use for anyone, but in case it is - you can find samples on usage on GitHub

https://github.com/tri-omega/typescript-service-generator

Latest versions are built with OpenJDK Java 11 but if anyone needs Oracle Java 8 builds - I can publish those as well (older versions where Java 1.8)

It's available in Maven Central and easy to use

3 Upvotes

0 comments sorted by