18
18
19
19
package test .org .springdoc .api .app174 ;
20
20
21
+ import java .util .Arrays ;
22
+ import java .util .List ;
21
23
import java .util .function .Consumer ;
22
24
import java .util .function .Function ;
23
25
import java .util .function .Supplier ;
26
+ import java .util .stream .Collectors ;
24
27
25
28
import io .swagger .v3 .oas .annotations .Operation ;
26
29
import io .swagger .v3 .oas .annotations .media .ArraySchema ;
29
32
import io .swagger .v3 .oas .annotations .responses .ApiResponse ;
30
33
import org .springdoc .core .annotations .RouterOperation ;
31
34
import org .springdoc .core .annotations .RouterOperations ;
32
- import reactor .core .publisher .Flux ;
33
35
import test .org .springdoc .api .AbstractSpringDocTest ;
36
+ import test .org .springdoc .api .app175 .PersonDTO ;
34
37
35
38
import org .springframework .boot .autoconfigure .SpringBootApplication ;
36
39
import org .springframework .cloud .function .context .config .ContextFunctionCatalogAutoConfiguration ;
@@ -52,7 +55,7 @@ public Function<String, String> reverseString() {
52
55
53
56
@ Bean
54
57
public Function <String , String > uppercase () {
55
- return value -> value . toUpperCase () ;
58
+ return String :: toUpperCase ;
56
59
}
57
60
58
61
@ Bean
@@ -62,25 +65,25 @@ public Function<String, String> uppercase() {
62
65
@ RouterOperation (method = RequestMethod .POST , operation = @ Operation (description = "Say hello POST" , operationId = "lowercasePOST" , tags = "positions" ,
63
66
responses = @ ApiResponse (responseCode = "200" , description = "new desc" , content = @ Content (array = @ ArraySchema (schema = @ Schema (implementation = String .class ))))))
64
67
})
65
- public Function <Flux <String >, Flux <String >> lowercase () {
66
- return flux -> flux . map ( value -> value . toLowerCase ());
68
+ public Function <List <String >, List <String >> lowercase () {
69
+ return list -> list . stream (). map ( String :: toLowerCase ). collect ( Collectors . toList ());
67
70
}
68
71
69
72
@ Bean (name = "titi" )
70
73
@ RouterOperation (operation = @ Operation (description = "Say hello By Id" , operationId = "hellome" , tags = "persons" ,
71
- responses = @ ApiResponse (responseCode = "200" , content = @ Content (schema = @ Schema (implementation = PersonDTO .class )))))
72
- public Supplier <PersonDTO > helloSupplier () {
73
- return () -> new PersonDTO () ;
74
+ responses = @ ApiResponse (responseCode = "200" , content = @ Content (schema = @ Schema (implementation = test . org . springdoc . api . app175 . PersonDTO .class )))))
75
+ public Supplier <test . org . springdoc . api . app175 . PersonDTO > helloSupplier () {
76
+ return test . org . springdoc . api . app175 . PersonDTO :: new ;
74
77
}
75
78
76
79
@ Bean
77
- public Consumer <PersonDTO > helloConsumer () {
78
- return personDTO -> personDTO . getFirstName () ;
80
+ public Consumer <test . org . springdoc . api . app175 . PersonDTO > helloConsumer () {
81
+ return PersonDTO :: getFirstName ;
79
82
}
80
83
81
84
@ Bean
82
- public Supplier <Flux <String >> words () {
83
- return () -> Flux . fromArray ( new String [] { "foo" , "bar" } );
85
+ public Supplier <List <String >> words () {
86
+ return () -> Arrays . asList ( "foo" , "bar" );
84
87
}
85
88
86
89
}
0 commit comments