Skip to content

[BUG][dart-dio] Deprecations on Schema Properties are disregarded #13818

@ma-pe

Description

@ma-pe
Description

Schema Deprecations on property level are not regarded when generating the Dart Dio Client. The resulting model property does not contain the @Deprecated annotation.

openapi-generator version

6.2.0

OpenAPI declaration file content or url

OpenAPI sample

Steps to reproduce

Just run

~/bin/openapi-generator-cli generate -i open_api.json -g dart-dio -o .

flutter pub run build_runner build --delete-conflicting-outputs

Then see the lib/model/product.dart.
It says:

@BuiltValue()
abstract class Product implements Built<Product, ProductBuilder> {
  @BuiltValueField(wireName: r'id')
  int? get id;

  @BuiltValueField(wireName: r'title')
  String? get title;

While it should say:

@BuiltValue()
abstract class Product implements Built<Product, ProductBuilder> {
  @BuiltValueField(wireName: r'id')
  int? get id;

  @Deprecated
  @BuiltValueField(wireName: r'title')
  String? get title;
Suggest a fix

I'll further look into it and will add details if I find something.

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