swagger 0.0.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 21

swagger

This package is deprecated!

Changelog

0.0.1

  • Initial version, created by Stagehand

example/swagger_example.dart

// Copyright (c) 2016, Ravi Teja Gudapati. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:swagger/swagger.dart';
import 'dart:io';
import 'package:yamlicious/yamlicious.dart';

main(List<String> args) {
  APIDocument doc = new APIDocument();
  doc.info.description =
      "Example API to swagger generation capabilities of Jaguar-dart";
  doc.info.title = "Sample swagger generation";
  doc.info.termsOfServiceURL = "All rights reserved!";
  doc.info.contact.email = "tejaience@gmail.com";
  doc.info.contact.name = "Ravi Teja Gudapati";
  doc.info.contact.url = "jaguar-dart.github.io";

  {
    APIHost host = new APIHost();
    doc.hosts.add(host);
  }

  doc.basePath = "/";

  doc.schemes.addAll(['http', 'https']);

  doc.consumes.add(ContentType.JSON);
  doc.produces.add(ContentType.JSON);

  {
    APIPath path = new APIPath();
    path.path = "/user";
    APIOperation op = new APIOperation();
    op.method = 'GET';

    op.consumes.add(ContentType.JSON);
    op.produces.add(ContentType.JSON);
    {
      APIParameterInlined param = new APIParameterInlined();
      param.name = "id";
      param.type = APISchemaObject.TypeInteger;
      param.parameterLocation = APIParameterLocation.path;
      op.parameters.add(param);
    }

    path.operations.add(op);
    doc.paths.add(path);
  }

  print(toYamlString(doc.asMap()));
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  swagger: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:swagger/swagger.dart';
  
Version Uploaded Documentation Archive
0.0.2 Dec 18, 2017 Go to the documentation of swagger 0.0.2 Download swagger 0.0.2 archive
0.0.1 Jan 13, 2017 Go to the documentation of swagger 0.0.1 Download swagger 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
42
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
21
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0