Skip to content

[REQ] [Dart] Models as value types #3797

@nickmeinhold

Description

@nickmeinhold

Is your feature request related to a problem? Please describe.

I would like to be able to have the generator produce models that are value types with features like immutability, state based equivalence and deep clone / copyWith.

Describe the solution you'd like

built_value

Describe alternatives you've considered

The openapitools generator could just add an overload of == and hashMap and a copyWith function to each model, but there are other benefits of built_value and (imo) it is a better option. It does require an extra code gen step though, and has the weird dart source_gen syntax so I'm sure it's not everyone's cup of tea.

Additional context

I don't know if this is something others would want but I plan to implement this for myself so I thought I would create an issue for discussion.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions