Open manabu0926 opened 1 week ago
checkout this project and survey,
this bug occured other same name type
defined.
e.g.
paths:
/api/driver_api/current_driver:
.
.
.
components:
schemas:
current_driver: ← this schema type exists, `fileContent.replaceAllMapped` replaced "CurrentDriver" with path route.
type: object
...
expected results exported this fix.
swagger_parser/lib/src/parser/corrector/open_api_corrector.dart:L54-62
fileContent = fileContent.replaceAllMapped(
RegExp('[ "\'/]$escapedType[ "\':]'),
(match) {
/// not replace paths `path end format`.
return match[0]!.startsWith('/') &&
match[0]!.endsWith(':')
? match[0]!
: match[0]!.replaceAll(type, correctType);
},
);
I would appreciate it if you could check it. :)
Steps to reproduce
1: define get request schema 2: dart run swagger_parser && dart run build_runner build -d 3: export error output
Expected results
export
Actual results
export
Your OpenApi snippet
Code sample
Code sample
```dart [Paste your code here] ```Logs
Logs
```console [Paste your logs here] ```Dart version and used packages versions
retrofit 4.4.1 carapacik_lints: ^1.9.1 dart_mappable_builder: ^4.3.0 freezed: ^2.5.7 json_serializable: ^6.8.0 retrofit_generator: ^9.1.3 swagger_parser: ^1.19.2