swagger 0.0.1

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

swagger #

A library for Dart developers. It is awesome.

Usage #

A simple usage example:

import 'package:swagger/swagger.dart';

main() {
  var awesome = new Awesome();
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

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.1

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
Awaiting analysis to complete.