swagger_to_dart 3.0.1 copy "swagger_to_dart: ^3.0.1" to clipboard
swagger_to_dart: ^3.0.1 copied to clipboard

Convert Swagger to Dart using freezed and retrofit support only 3.1.0 openApi

example/lib/main.dart

import 'package:dio/dio.dart';
import 'package:retrofit/dio.dart';

import 'src/gen/gen.dart';

Future<void> main(List<String> args) async {
  final dio = Dio();

  dio.options.baseUrl = 'http://0.0.0.0:8004';

  final apiClient = CustomApiClient(dio);

  final HttpResponse<BaseResponse<PaginationResponse<ItemResponse>>> response =
      await apiClient.genericClient.genericGetNestedBaseAndPagination(
    queries: GenericGetNestedBaseAndPaginationQueryParameters(
      page: 1,
      perPage: 10,
    ),
  );

  print(response.data.data.items.firstOrNull?.name);
}
13
likes
140
points
1.11k
downloads

Publisher

verified publishermatheer.com

Weekly Downloads

Convert Swagger to Dart using freezed and retrofit support only 3.1.0 openApi

Homepage
View/report issues

Topics

#swagger #openapi #generator #freezed #retrofit

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

args, code_builder, collection, dart_style, dio, freezed_annotation, json_annotation, logger, path, pubspec_parse, retrofit, yaml

More

Packages that depend on swagger_to_dart