ModelClassGenerator class
Generates Dart model classes for API responses based on OpenAPI/Swagger specs.
This generator reads route information and content schemas to create strongly-typed model classes, including handling of enums, nested subclasses, imports, constructors, and JSON (de)serialization helpers.
Constructors
- ModelClassGenerator({required Components components, required String mainPath, required String globalEnumsFileString, required bool isMVVM})
- Creates a new ModelClassGenerator.
Properties
- components → Components
-
OpenAPI components providing access to schemas and references.
final
- globalEnumsFileString → String
-
The concatenated contents of the global enums file, used to avoid
regenerating enums that already exist globally.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isMVVM → bool
-
final
- mainPath → String
-
The root path where generated files should be written.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
generateClass(
RouteInfo routeInfo) → void -
Generates a model class file for the given
routeInfo. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited