diff --git a/CHANGELOG.md b/CHANGELOG.md index a8e44d0..47ee31a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 0.4.7 +## 0.4.8 * Add default value for schema validation constants diff --git a/lib/src/generators/schema.dart b/lib/src/generators/schema.dart index 6e66f48..6dd30db 100644 --- a/lib/src/generators/schema.dart +++ b/lib/src/generators/schema.dart @@ -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); } } @@ -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); } diff --git a/pubspec.yaml b/pubspec.yaml index 4c0d066..8b19086 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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