|
16 | 16 |
|
17 | 17 | package com.github.hauner.openapi.api;
|
18 | 18 |
|
| 19 | +import java.util.Map; |
| 20 | + |
19 | 21 | /**
|
20 | 22 | * To make an openapi-generatr available to a consumer (for example the openapi-generatr-gradle plugin)
|
21 | 23 | * it must implement this interface and have a
|
|
26 | 28 | * A consumer should be able to provide access to any generatr that is found on the class path.
|
27 | 29 | *
|
28 | 30 | * <p>
|
29 |
| - * For example the gradle plugin will provide a gradle task and options object for each generatr that |
30 |
| - * is available via this service interface. For |
31 |
| - * <a href="https://github.com/hauner/openapi-generatr-spring">openapi-generatr-spring</a> (based |
32 |
| - * on the generatr name) this will be a {@code generateSpring} task to run the generatr and a |
33 |
| - * {@code generatrSpring} options object to configure it. |
| 31 | + * For example the gradle plugin will provide a gradle task for each (configured) generatr. This task |
| 32 | + * will find & run a generatr by using this service interface. By using the service interface it does |
| 33 | + * not need an explicit dependency on a generatr. |
34 | 34 | *
|
35 | 35 | * @author Martin Hauner
|
36 | 36 | */
|
37 |
| -public interface OpenApiGeneratr<T> { |
| 37 | +public interface OpenApiGeneratr { |
38 | 38 |
|
39 | 39 | /**
|
40 | 40 | * The identifying name of the generatr. *Should* be globally unique so a consumer of this
|
41 | 41 | * interface can distinguish between different generatrs.
|
42 | 42 | *
|
43 | 43 | * <p>
|
44 | 44 | * It is recommended to return here the last part of the full generatr name. If the generatr
|
45 |
| - * jar name is {@code openapi-generatr-spring} the name should be {@code Spring}. |
| 45 | + * jar name is {@code openapi-generatr-spring} the name should be {@code spring}. |
46 | 46 | * </p>
|
47 | 47 | *
|
48 | 48 | * @return the unique name of the generatr
|
49 | 49 | */
|
50 | 50 | String getName();
|
51 | 51 |
|
52 | 52 | /**
|
53 |
| - * the type of the generatr options given to the run() method. |
54 |
| - * |
55 |
| - * @return options class |
56 |
| - */ |
57 |
| - Class<T> getOptionsType(); |
58 |
| - |
59 |
| - /** |
60 |
| - * Runs the generatr with the given options. |
| 53 | + * Runs the generatr with the given options. The options are key value pairs. Keys are of type |
| 54 | + * {@code String} and values are of any type. A property hierarchy is possible by using |
| 55 | + * {@code Map}s as value. |
61 | 56 | *
|
62 | 57 | * @param options the generatr configuration
|
63 | 58 | */
|
64 |
| - void run(T options); |
| 59 | + void run(Map<String, ?> options); |
65 | 60 |
|
66 | 61 | }
|
0 commit comments