Browse Source

Merge pull request #979 from nextcloud/fix/dynamite/openapi_model

fix(dynamite): fix license nullability
pull/992/head
Nikolas Rimikis 1 year ago committed by GitHub
parent
commit
7a511100f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/dynamite/dynamite/lib/src/models/openapi/info.dart
  2. 19
      packages/dynamite/dynamite/lib/src/models/openapi/info.g.dart

2
packages/dynamite/dynamite/lib/src/models/openapi/info.dart

@ -16,7 +16,7 @@ abstract class Info implements Built<Info, InfoBuilder> {
String get version; String get version;
License get license; License? get license;
@BuiltValueField(compare: false) @BuiltValueField(compare: false)
String? get description; String? get description;

19
packages/dynamite/dynamite/lib/src/models/openapi/info.g.dart

@ -21,10 +21,14 @@ class _$InfoSerializer implements StructuredSerializer<Info> {
serializers.serialize(object.title, specifiedType: const FullType(String)), serializers.serialize(object.title, specifiedType: const FullType(String)),
'version', 'version',
serializers.serialize(object.version, specifiedType: const FullType(String)), serializers.serialize(object.version, specifiedType: const FullType(String)),
'license',
serializers.serialize(object.license, specifiedType: const FullType(License)),
]; ];
Object? value; Object? value;
value = object.license;
if (value != null) {
result
..add('license')
..add(serializers.serialize(value, specifiedType: const FullType(License)));
}
value = object.description; value = object.description;
if (value != null) { if (value != null) {
result result
@ -70,16 +74,15 @@ class _$Info extends Info {
@override @override
final String version; final String version;
@override @override
final License license; final License? license;
@override @override
final String? description; final String? description;
factory _$Info([void Function(InfoBuilder)? updates]) => (InfoBuilder()..update(updates))._build(); factory _$Info([void Function(InfoBuilder)? updates]) => (InfoBuilder()..update(updates))._build();
_$Info._({required this.title, required this.version, required this.license, this.description}) : super._() { _$Info._({required this.title, required this.version, this.license, this.description}) : super._() {
BuiltValueNullFieldError.checkNotNull(title, r'Info', 'title'); BuiltValueNullFieldError.checkNotNull(title, r'Info', 'title');
BuiltValueNullFieldError.checkNotNull(version, r'Info', 'version'); BuiltValueNullFieldError.checkNotNull(version, r'Info', 'version');
BuiltValueNullFieldError.checkNotNull(license, r'Info', 'license');
} }
@override @override
@ -140,7 +143,7 @@ class InfoBuilder implements Builder<Info, InfoBuilder> {
if ($v != null) { if ($v != null) {
_title = $v.title; _title = $v.title;
_version = $v.version; _version = $v.version;
_license = $v.license.toBuilder(); _license = $v.license?.toBuilder();
_description = $v.description; _description = $v.description;
_$v = null; _$v = null;
} }
@ -168,13 +171,13 @@ class InfoBuilder implements Builder<Info, InfoBuilder> {
_$Info._( _$Info._(
title: BuiltValueNullFieldError.checkNotNull(title, r'Info', 'title'), title: BuiltValueNullFieldError.checkNotNull(title, r'Info', 'title'),
version: BuiltValueNullFieldError.checkNotNull(version, r'Info', 'version'), version: BuiltValueNullFieldError.checkNotNull(version, r'Info', 'version'),
license: license.build(), license: _license?.build(),
description: description); description: description);
} catch (_) { } catch (_) {
late String _$failedField; late String _$failedField;
try { try {
_$failedField = 'license'; _$failedField = 'license';
license.build(); _license?.build();
} catch (e) { } catch (e) {
throw BuiltValueNestedFieldError(r'Info', _$failedField, e.toString()); throw BuiltValueNestedFieldError(r'Info', _$failedField, e.toString());
} }

Loading…
Cancel
Save