swagger_dart_code_generator 2.15.2 copy "swagger_dart_code_generator: ^2.15.2" to clipboard
swagger_dart_code_generator: ^2.15.2 copied to clipboard

Have you been turned into a problem with writing code for Http requests? This package can help. It has all of the Http and model codegen functionality you have been looking for.

example/lib/main.dart

import 'package:example/swagger_generated_code/pet_service_yaml.swagger.dart';

void main() async {
  final petsApi = PetServiceYaml.create();

  final postResult = await petsApi.petPost(
    body: Pet(
      name: 'Vovanella',
      photoUrls: [
        'https://i.ytimg.com/vi/hO6G8jxV-YU/maxresdefault.jpg',
        'https://i.ytimg.com/vi/5u3iv8AT8G8/maxresdefault.jpg'
      ],
      status: PetStatus.available,
      category: Category(),
    ),
  );

  final pet = Pet.fromJson(postResult.body as Map<String, dynamic>);

  print('Created pet id: ${pet.id}');
}
270
likes
120
pub points
89%
popularity

Publisher

verified publishermobilepeople.dev

Have you been turned into a problem with writing code for Http requests? This package can help. It has all of the Http and model codegen functionality you have been looking for.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

build, code_builder, collection, dart_style, http, json_annotation, markdown, path, recase, universal_io, yaml

More

Packages that depend on swagger_dart_code_generator