Skip to content

Commit 557f13b

Browse files
committed
fix isRequired / isDeprecated
1 parent 3554723 commit 557f13b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/src/v3/parameter.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ class APIParameter extends APIObject {
159159
/// Determines whether this parameter is mandatory.
160160
///
161161
/// If the parameter location is "path", this property is REQUIRED and its value MUST be true. Otherwise, the property MAY be included and its default value is false.
162-
bool? get isRequired =>
163-
(location == APIParameterLocation.path ? true : _required);
162+
bool get isRequired =>
163+
(location == APIParameterLocation.path ? true : _required ?? false);
164164

165165
set isRequired(bool? f) {
166166
_required = f;
@@ -169,7 +169,7 @@ class APIParameter extends APIObject {
169169
bool? _required = false;
170170

171171
/// Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.
172-
bool? get isDeprecated => _deprecated;
172+
bool get isDeprecated => _deprecated ?? false;
173173

174174
set isDeprecated(bool? f) {
175175
_deprecated = f;

0 commit comments

Comments
 (0)