swagger 0.0.2

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

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()));
}

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

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
24 / 100
Health:
Code health derived from static analysis. [more]
92 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
95 / 100
Overall score:
Weighted score of the above. [more]
59

Platforms

Detected platforms: other

Primary library: package:swagger/swagger.dart with components: io, mirrors.

Suggestions

  • Fix lib/src/swagger/api_operation.dart.

    Strong-mode analysis of lib/src/swagger/api_operation.dart failed with the following error:

    line: 22 col: 11
    The setter 'schemaObject' isn't defined for the class 'APIParameter'.

  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 1 error(s) and 0 warning(s).

  • Fix .analysis_options.

    We were unable to parse .analysis_options.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

  • Enable strong mode analysis.

    Strong mode helps you to detect bugs and potential issues earlier.Start your analysis_options.yaml file with the following:

    analyzer:
      strong-mode: true
    

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0
Dev dependencies
test >=0.12.0 <0.13.0
yamlicious >=0.0.5 <0.1.0