OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
20.56k stars 6.28k forks source link

[BUG] [dart] Invalid code generated (validation_error_loc_inner.dart) (openapi 3.1.0) #18913

Closed Gigahawk closed 2 weeks ago

Gigahawk commented 2 weeks ago

Bug Report Checklist

Description

Using the dart generator creates code that does not compile due to errors in validation_error_loc_inner.dart

...
class ValidationErrorLocInner {
  /// Returns a new [ValidationErrorLocInner] instance.
  ValidationErrorLocInner({
  });

  @override
  bool operator ==(Object other) => identical(this, other) || other is ValidationErrorLocInner &&

  @override
  int get hashCode =>
    // ignore: unnecessary_parenthesis
...

A screenshot to show highlighting of invalid syntax: image

openapi-generator version
$ openapi-generator-cli version
7.6.0
OpenAPI declaration file content or url

https://gist.github.com/Gigahawk/a2e79529adb4206fd23c86e9c28a0380

Generation Details
Steps to reproduce
$ openapi-generator-cli generate -i openapi.json -g dart -o packages/openapi
Related issues/PRs

https://github.com/gibahjoe/openapi-generator-dart/issues/135

Suggest a fix
Gigahawk commented 2 weeks ago

Duplicate of https://github.com/OpenAPITools/openapi-generator/issues/13302