blue-veery-gmbh / spring-rest-2-ts

spring rest 2 ts is typescript generator which produces data model and services in typescript based on Spring MVC annotations. It supports generation for Angular and React
MIT License
64 stars 17 forks source link

Spring 6.x and Spring Data 3.x support #52

Open ragnor opened 5 months ago

ragnor commented 5 months ago

There are dependencies in modules ([spring-rest2ts-spring, spring-rest2ts-spring-data) to Spring 5.x and Spring Data 2.x. Will it work with Spring 6.x and Spring Data 3.x out of the box or new version has to be released?

tomasz-wozniak75 commented 4 months ago

Hi Library depends on the spring API in limited way, only on annotations and in case of spring data on 1-2 classes I doubt that they have been changed so you can safely use this generation with any spring version. Upgrade to higher spring version could only be required in case of breaking change in the mentioned api which we would like to use.

ragnor commented 4 months ago

Thanks Tom!

So there are not direct or indirect references to any javax.* class? As this is the main change and challenge when migrating from Spring 5.x to 6.x, (almost) all javax have to be replaced by jakarta.

tomasz-wozniak75 commented 4 months ago

Sorry I focused my minds on the potential changes just in spring api, and now I double checked if we are using something from the javax package. If you exclude following packages which are not needed for spring code generation:

  1. spring-rest2ts-examples
  2. spring-rest2ts-gson
  3. spring-rest2ts-jax-rs
  4. spring-rest2ts-tests

The only usage of class from javax package is for javax.annotation.Nullable in DefaultNullableTypesStrategy class which will cause that java elements marked with Nullable annotation in the new package will not be used to mark fields or types as nullable in TS but You can create your own implementation of NullableTypesStrategy interface where you can use Nullable from the new package. Not used classes are not loaded in java so DefaultNullableTypesStrategy should not make any problems.

Migration to jakarta package requires new release but now I have busy period I will be able to do it on the beginning of May