@@ -15,27 +15,12 @@ Generate typescript services and type interfaces from spring annotated @RestCont
1515
1616Get strongly typed interfaces for your spring-boot microservices in no time.
1717
18- # Release 0.3.0 is here, What's new?
19- * Support for Generics besides Collections and Maps and improved handling of nested Type-Parameters.
20- * In particular, ResponseEntity<..> and Optional<..> can now be utilized as wrapping Type.
21- * Optional<Type > as Parameter now generates optional Functionparameters.
22- ``` typescript
23- public setFooPost (requiredParameter : number , optionalParamer ?: string ) ...
24- ```
25- * @RequestBody is optional now and can be omitted or substituted by a MultipartFile,
26- which generates a FormData parameter.
27- ``` java
28- @RequestMapping (value = " /upload/{id}" , method = POST , consumes = APPLICATION_JSON_VALUE , produces = APPLICATION_JSON_VALUE )
29- public ResponseEntity<UploadResponse > fileUpload(
30- @PathVariable (" id" ) long id,
31- @RequestParam (" uploadfile" ) MultipartFile uploadfile,
32- @Context HttpServletRequest request) {... }
33- ```
34- ``` typescript
35- public fileUploadPost (uploadfile : FormData , id : number ) ...
36- ```
37- * Controllers can now be configured through ServiceConfig to enabled debug mode or set the context root in other words a
38- prefix for all request URLs.
18+ # Release 0.4.0 is here, What's new?
19+ * TypeScriptEndpoints can now be Interfaces and they recognize @RequestMapping annotated Methods in Supertypes and Interfaces
20+ * Method suffixes in generated TypeScript files can now be configured or turned off (see @TypeScriptTemplatesConfiguration )
21+ * Unset http-parameters won't be send to the server now
22+
23+ Thanks to [ jscharett] ( https://github.com/jscharett ) for the provided help.
3924
4025# What is it?
4126A Java annotation processor to generate a service and TypeScript types to access your spring @RestControllers .
@@ -48,16 +33,36 @@ You can specify your own template files or use the bundled defaults.
4833
4934# Getting started
5035Just specify the dependency in your maven based build.
51-
36+ ** Maven **
5237``` xml
5338<dependency >
5439 <groupId >org.leandreck.endpoints</groupId >
5540 <artifactId >annotations</artifactId >
41+ <version >0.4.0</version >
5642 <scope >provided</scope > <!-- the annotations and processor are only needed at compile time -->
5743 <optional >true</optional > <!-- they need not to be transitively included in dependent artifacts -->
5844</dependency >
5945<!-- * because of spring-boot dependency handling they nevertheless get included in fat jars -->
6046```
47+ ** Gradle**
48+ ``` gradle
49+ compileOnly 'org.leandreck.endpoints:annotations:0.4.0'
50+ ```
51+
52+ And annotate a Spring @Restcontroller with @TypeScriptEndpoint and your next compile will generate TypeScript-files for every Method with
53+ a RequestMapping producing "application/json".
54+
55+ # Customization
56+ ## Configuration and custom Templates
57+
58+ You can configure with @TypeScriptTemplatesConfiguration if and what Method suffix are used in the default templates or provide your own.
59+ If you want to provide your own templates have a look at the default ones
60+ [ org.leandreck.enpoints.templates.typescript] ( https://github.com/leandreck/spring-typescript-services/tree/development/annotations/src/main/resources/org/leandreck/endpoints/templates/typescript )
61+
62+ If you want to exclude a Method you can annotate it with @TypeScriptIgnore .
63+
64+ ## ServiceConfig
65+ You can configure the generated controllers through ServiceConfig to enabled debug mode or set the context root all request URLs.
6166
6267# Example
6368The following snippet will produce an Angular Module.
0 commit comments