Carapacik / swagger_parser

Dart package that takes an OpenApi definition file and generates REST clients based on retrofit and data classes for your project.
https://pub.dev/packages/swagger_parser
MIT License
87 stars 33 forks source link

use built in types as dto names & import dart:io #201

Closed dickermoshe closed 4 months ago

dickermoshe commented 4 months ago

We need to add

double
int
num
bool
null
dynamic
void

to reserved words

Also dart:io wasnt imported only for dart mappable

// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, unused_import

import 'package:dart_mappable/dart_mappable.dart';

part 'format_test.mapper.dart';

@MappableClass()
class FormatTest with FormatTestMappable {

  const FormatTest({
    required this.integer,
    required this.int32,
    required this.int64,
    required this.number,
    required this.float,
    required this.double,
    required this.decimal,
    required this.string,
    required this.byte,
    required this.binary,
    required this.date,
    required this.dateTime,
    required this.uuid,
    required this.password,
    required this.patternWithDigits,
    required this.patternWithDigitsAndDelimiter,
  });

  final int integer;
  final int int32;
  final int int64;
  final num number;
  final double float;
  final double double;
  final String decimal;
  final String string;
  final String byte;
  final File binary;
  final DateTime date;
  final DateTime dateTime;
  final String uuid;
  final String password;
  final String patternWithDigits;
  final String patternWithDigitsAndDelimiter;

  static FormatTest fromJson(Map<String, dynamic> json) => FormatTestMapper.ensureInitialized().decodeMap<FormatTest>(json);
}