Skip to content

Commit a538862

Browse files
committed
fix(dynamite): always require content for a request body
Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
1 parent e7b503d commit a538862

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

packages/dynamite/dynamite/lib/src/builder/client.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Iterable<Method> buildTags(
232232
({String mimeType, TypeResult result})? bodyParameter;
233233
final requestBody = operation.requestBody;
234234
if (requestBody != null) {
235-
for (final content in requestBody.content!.entries) {
235+
for (final content in requestBody.content.entries) {
236236
if (bodyParameter != null) {
237237
print('Can not work with multiple mime types right now. Using the first supported.');
238238
break;

packages/dynamite/dynamite/lib/src/models/openapi/request_body.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ abstract class RequestBody implements Built<RequestBody, RequestBodyBuilder> {
1515
@BuiltValueField(compare: false)
1616
String? get description;
1717

18-
BuiltMap<String, MediaType>? get content;
18+
BuiltMap<String, MediaType> get content;
1919

2020
bool get required;
2121

packages/dynamite/dynamite/lib/src/models/openapi/request_body.g.dart

+9-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)