@@ -74,12 +74,15 @@ Annotate a dart class with @Openapi() annotation
74
74
75
75
` ` ` dart
76
76
@Openapi(
77
- additionalProperties :
78
- AdditionalProperties(pubName : ' petstore_api' , pubAuthor: 'Johnny dep'),
79
- inputSpecFile : ' example/openapi-spec.yaml' ,
80
- generatorName : Generator.dart,
81
- outputDirectory : ' api/petstore_api' )
82
- class Example {}
77
+ additionalProperties :
78
+ DioProperties(pubName : ' petstore_api' , pubAuthor: 'Johnny dep..'),
79
+ inputSpec :
80
+ RemoteSpec(path : ' https://petstore3.swagger.io/api/v3/openapi.json' ),
81
+ typeMappings : {'Pet': 'ExamplePet'},
82
+ generatorName : Generator.dio,
83
+ runSourceGenOnOutput : true,
84
+ outputDirectory : ' api/petstore_api' ,
85
+ )
83
86
```
84
87
85
88
Run
@@ -99,7 +102,8 @@ The api sdk will be generated in the folder specified in the annotation. See exa
99
102
100
103
## Next Generation
101
104
102
- There is some new functionality slated to be added to the generator. This version will have the ability to:
105
+ As of version 5.0 of this library, there is some new functionality slated to be added to the generator. This version
106
+ will have the ability to:
103
107
104
108
- cache changes in the OAS spec
105
109
- Rerun when there ares difference in the cached copy and current copy
@@ -118,25 +122,18 @@ New:
118
122
119
123
``` dart
120
124
@Openapi(
121
- additionalProperties:
122
- AdditionalProperties(pubName: 'petstore_api', pubAuthor: 'Johnny dep'),
123
- inputSpecFile: 'example/openapi-spec.yaml',
124
- generatorName: Generator.dart,
125
- outputDirectory: 'api/petstore_api',
126
- cachePath: 'some/preferred/directory/cache.json',
127
- useNextGen: true
125
+ additionalProperties:
126
+ DioProperties(pubName: 'petstore_api', pubAuthor: 'Johnny dep..'),
127
+ inputSpec:
128
+ RemoteSpec(path: 'https://petstore3.swagger.io/api/v3/openapi.json'),
129
+ typeMappings: {'Pet': 'ExamplePet'},
130
+ generatorName: Generator.dio,
131
+ runSourceGenOnOutput: true,
132
+ outputDirectory: 'api/petstore_api',
128
133
)
129
134
class Example {}
130
135
```
131
136
132
- ** IMPORTANT** With the new changes comes 2 new annotation properties:
133
-
134
- - useNextGen (boolean)
135
- - Default: ` false `
136
- - cachePath (String)
137
- - Default: ` .dart_tool/openapi-generator-cache.json `
138
- - Must be a path to a ` json ` file.
139
- - Can only be set when ` useNextGen ` is ` true `
140
137
141
138
## Contributing
142
139
0 commit comments