Skip to content

Commit

Permalink
Follow up to default value in schema generation - part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
walsha2 committed Aug 6, 2023
1 parent a432768 commit 084942d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 0.4.7
## 0.4.8

* Add default value for schema validation constants

Expand Down
4 changes: 2 additions & 2 deletions lib/src/generators/schema.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class SchemaGenerator extends BaseGenerator {
property: props![propName]!,
required: schema.required?.contains(propName) ?? false,
);
if (v != null && v.operations.isNotEmpty) {
if (v != null && (v.constants.isNotEmpty || v.operations.isNotEmpty)) {
validations.add(v);
}
}
Expand Down Expand Up @@ -317,7 +317,7 @@ class SchemaGenerator extends BaseGenerator {
property: prop,
required: s.required?.contains(propName) ?? false,
);
if (v != null && v.operations.isNotEmpty) {
if (v != null && (v.constants.isNotEmpty || v.operations.isNotEmpty)) {
validations.add(v);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: openapi_spec
description: OpenAPI Specification generator using native Dart code, as well as an all-in-one parser of existing specifications.
version: 0.4.7
version: 0.4.8
maintainer: Taza Technology LLC
repository: https://github.com/tazatechnology/openapi_spec
issue_tracker: https://github.com/tazatechnology/openapi_spec/issues
Expand Down

0 comments on commit 084942d

Please sign in to comment.