Skip to content

Commit

Permalink
Convert union classes to sealed
Browse files Browse the repository at this point in the history
  • Loading branch information
walsha2 committed Aug 3, 2023
1 parent c241b2f commit 23c8897
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.4.5

* Convert union types to sealed classes
* Make union constructors public

## 0.4.4

* Reduce collection package version requirement
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 @@ -173,7 +173,7 @@ class SchemaGenerator extends BaseGenerator {
/// Union class for ${schemas.map((e) => '[$e]').join(', ')}
@Freezed(unionKey: '$unionKey')
class $union with _\$$union {
sealed class $union with _\$$union {
const $union._();\n
""", mode: FileMode.append);

Expand Down Expand Up @@ -240,7 +240,7 @@ class SchemaGenerator extends BaseGenerator {
}

/// Class Footer
file.writeAsStringSync("}) = _$union$uSubClass;\n\n",
file.writeAsStringSync("}) = $union$uSubClass;\n\n",
mode: FileMode.append);
}

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.4
version: 0.4.5
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 23c8897

Please sign in to comment.