diff --git a/packages/dynamite/dynamite/lib/src/builder/client.dart b/packages/dynamite/dynamite/lib/src/builder/client.dart index f7c6f962..2a72388f 100644 --- a/packages/dynamite/dynamite/lib/src/builder/client.dart +++ b/packages/dynamite/dynamite/lib/src/builder/client.dart @@ -499,7 +499,7 @@ final authentication = $client.authentications.firstWhereOrNull( yield* securityRequirements.map((final requirement) { final securityScheme = spec.components!.securitySchemes![requirement.keys.single]!; final dynamiteAuth = toDartName( - 'Dynamite-${securityScheme.type}-${securityScheme.scheme}-Authentication', + 'Dynamite-${securityScheme.fullName.join('-')}-Authentication', uppercaseFirstCharacter: true, ); return '$dynamiteAuth()'; diff --git a/packages/dynamite/dynamite/lib/src/models/openapi/security_scheme.dart b/packages/dynamite/dynamite/lib/src/models/openapi/security_scheme.dart index 8580e29b..33ef00d3 100644 --- a/packages/dynamite/dynamite/lib/src/models/openapi/security_scheme.dart +++ b/packages/dynamite/dynamite/lib/src/models/openapi/security_scheme.dart @@ -1,5 +1,6 @@ import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; +import 'package:collection/collection.dart'; part 'security_scheme.g.dart'; @@ -16,4 +17,10 @@ abstract class SecurityScheme implements Built get fullName => [type, scheme, $in, name].whereNotNull(); } diff --git a/packages/dynamite/dynamite/lib/src/models/openapi/security_scheme.g.dart b/packages/dynamite/dynamite/lib/src/models/openapi/security_scheme.g.dart index 3fe9f1df..d5796b69 100644 --- a/packages/dynamite/dynamite/lib/src/models/openapi/security_scheme.g.dart +++ b/packages/dynamite/dynamite/lib/src/models/openapi/security_scheme.g.dart @@ -34,6 +34,18 @@ class _$SecuritySchemeSerializer implements StructuredSerializer ..add('scheme') ..add(serializers.serialize(value, specifiedType: const FullType(String))); } + value = object.$in; + if (value != null) { + result + ..add('\$in') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } + value = object.name; + if (value != null) { + result + ..add('name') + ..add(serializers.serialize(value, specifiedType: const FullType(String))); + } return result; } @@ -57,6 +69,12 @@ class _$SecuritySchemeSerializer implements StructuredSerializer case 'scheme': result.scheme = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; break; + case '\$in': + result.$in = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; + case 'name': + result.name = serializers.deserialize(value, specifiedType: const FullType(String)) as String?; + break; } } @@ -71,11 +89,15 @@ class _$SecurityScheme extends SecurityScheme { final String? description; @override final String? scheme; + @override + final String? $in; + @override + final String? name; factory _$SecurityScheme([void Function(SecuritySchemeBuilder)? updates]) => (SecuritySchemeBuilder()..update(updates))._build(); - _$SecurityScheme._({required this.type, this.description, this.scheme}) : super._() { + _$SecurityScheme._({required this.type, this.description, this.scheme, this.$in, this.name}) : super._() { BuiltValueNullFieldError.checkNotNull(type, r'SecurityScheme', 'type'); } @@ -88,7 +110,11 @@ class _$SecurityScheme extends SecurityScheme { @override bool operator ==(Object other) { if (identical(other, this)) return true; - return other is SecurityScheme && type == other.type && scheme == other.scheme; + return other is SecurityScheme && + type == other.type && + scheme == other.scheme && + $in == other.$in && + name == other.name; } @override @@ -96,6 +122,8 @@ class _$SecurityScheme extends SecurityScheme { var _$hash = 0; _$hash = $jc(_$hash, type.hashCode); _$hash = $jc(_$hash, scheme.hashCode); + _$hash = $jc(_$hash, $in.hashCode); + _$hash = $jc(_$hash, name.hashCode); _$hash = $jf(_$hash); return _$hash; } @@ -105,7 +133,9 @@ class _$SecurityScheme extends SecurityScheme { return (newBuiltValueToStringHelper(r'SecurityScheme') ..add('type', type) ..add('description', description) - ..add('scheme', scheme)) + ..add('scheme', scheme) + ..add('\$in', $in) + ..add('name', name)) .toString(); } } @@ -125,6 +155,14 @@ class SecuritySchemeBuilder implements Builder _$this._scheme; set scheme(String? scheme) => _$this._scheme = scheme; + String? _$in; + String? get $in => _$this._$in; + set $in(String? $in) => _$this._$in = $in; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + SecuritySchemeBuilder(); SecuritySchemeBuilder get _$this { @@ -133,6 +171,8 @@ class SecuritySchemeBuilder implements Builder get headers;