discoveryapis_generator 0.9.9

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 80

discoveryapis_generator

Build Status

Description

Dart application to generate Dart API Client Libraries based on discovery documents.

This package is used to generate client libraries for packages exposing a REST API using the package:rpc package.

Usage

$ dart bin/generate.dart -h
Usage:
The discovery generator supports the following subcommands:

  package
  files

The 'package' subcommand generates an API package from already downloaded
discovery documents. It takes the following options:

-i, --input-dir              Input directory of discovery documents.
                             (defaults to "googleapis-discovery-documents")

-o, --output-dir             Output directory of the generated API package.
                             (defaults to "googleapis")

    --package-name           Name of the generated API package.
                             (defaults to "googleapis")

    --package-version        Version of the generated API package.
                             (defaults to "0.1.0-dev")

    --package-description    Description of the generated API package.
                             (defaults to "Auto-generated client libraries.")

    --package-author         Author of the generated API package.
    --package-homepage       Homepage of the generated API package.

The 'files' subcommand generates API files into an existing package from already
downloaded discovery documents. One file per API. It takes the following
options:

-i, --input-dir             Input directory of discovery documents.
-o, --output-dir            Output directory of the generated API files.
-u, --update-pubspec        Update the pubspec.yaml file with required dependencies. This will remove comments and might change the layout of the pubspec.yaml file.
                            (defaults to "false")

    --[no-]core-prefixes    Use or remove an import prefix for dart:core
                            (defaults to on)

Changelog - discoveryapis_generator

v0.9.9

  • Generate packages with pubspecs that accept sdk 2.0.0 and above.

v0.9.8

  • Make the generator Dart 2.0 clean.

v0.9.7

  • Support data-wrapping of response bodies. This is a deprecated feature, but it is being used by the Translate v2 API.
  • Ignore unnecessary_cast lint in generated files.
  • Add .toDouble() conversion where necessary.

v0.9.6

  • More Dart 2 fixes. Add .map() and .cast() to Lists and Maps to get the types right at runtime.

v0.9.5

  • More type annotations for Dart 2.

v0.9.4

  • Use type arguments for Map, since dynamic is no longer bottom.
  • Avoid unnecessary imports of dart:convert.

v0.9.3

  • Minor cleanups.

v0.9.2

  • Add support for global request parameters, currently whitelisted to only allow "fields".

v0.9.1+2

  • Widen dependency constraint on package:args.

v0.9.1+1

  • Use < 2.0.0 sdk constraint in generated pubspec.yaml files (following the new guideline).

v0.9.1

  • Avoid unused imports in generated tests.
  • Use new-style /// comments for generated code.
  • Use package:dart_style for formatting the generated code.
  • Use < 2.0.0-dev.infinity sdk constraint in generated pubspec.yaml files.

v0.9.0

  • Make generated code strong mode clean.
  • Make generated code use package:test instead of package:unittest.

v0.8.0+2

  • Make package:discoveryapis_generator strong mode clean.

v0.8.0+1

  • Require at least Dart 1.14 for generated libraries. Code requires dart:convert BASE64 which was added to that release.

v0.8.0

  • Remove crypto dependency from generated libraries and upgrade sdk dependency to dart 1.13

v0.7.2

  • Update the code generator to only generate imports for libraries that are used (this avoids having analysis warnings for unused imports in the generate code).
  • Add a command-line option to not generate library prefixes for the dart:core and dart:async libraries (--no-core-prefixes).

v0.7.1+1

  • Make findPackageRoot handle 'file:' paths.

v0.7.1

  • Fix bug in windows path handling.

v0.7.0

  • Add support for generating API files inside an existing package instead of generating an entirely new package.
  • Changed the generators command names to 'package' and 'files' respectively to make it clear what is being generated.
  • Added support for generating a client stub API using the same message classes as used on the server.

v0.6.1

  • Updated README

v0.6.0

  • Change generator to use the discoveryapis_commons package for generated code
  • Remove googleapis commands and split out separate googleapis library

v0.5.0

  • Merged new generator implementation from experimental branch to master

0.4.5 2014-05-16 (SDK 1.4.0-dev.6.7 r36210)

  • Set uploadType as multipart by default
  • Rev up bot_io

0.4.4 2014-03-22 (SDK 1.3.0-dev.5.2 r34229)

  • Added Geo JSON support
  • Added support for schema array object
  • Added support for schema any object
  • Updated generated dependencies
  • Cleaned up hop runner

v0.4.3

v0.4.2

v0.4.1

v0.4.0

v0.3.0

v0.2.8

v0.2.6

v0.2.5

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate discoveryapis_generator

2. Use it

The package has the following executables:


$ discoveryapis_generator

Use this package as a library

1. Depend on it

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


dependencies:
  discoveryapis_generator: ^0.9.9

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:discoveryapis_generator/discoveryapis_generator.dart';
  
Version Uploaded Documentation Archive
0.9.9 Aug 6, 2018 Go to the documentation of discoveryapis_generator 0.9.9 Download discoveryapis_generator 0.9.9 archive
0.9.8 Jul 3, 2018 Go to the documentation of discoveryapis_generator 0.9.8 Download discoveryapis_generator 0.9.8 archive
0.9.7 May 29, 2018 Go to the documentation of discoveryapis_generator 0.9.7 Download discoveryapis_generator 0.9.7 archive
0.9.6 May 9, 2018 Go to the documentation of discoveryapis_generator 0.9.6 Download discoveryapis_generator 0.9.6 archive
0.9.5 Apr 19, 2018 Go to the documentation of discoveryapis_generator 0.9.5 Download discoveryapis_generator 0.9.5 archive
0.9.4 Feb 19, 2018 Go to the documentation of discoveryapis_generator 0.9.4 Download discoveryapis_generator 0.9.4 archive
0.9.3 Jan 26, 2018 Go to the documentation of discoveryapis_generator 0.9.3 Download discoveryapis_generator 0.9.3 archive
0.9.2 Oct 17, 2017 Go to the documentation of discoveryapis_generator 0.9.2 Download discoveryapis_generator 0.9.2 archive
0.9.1+2 Oct 5, 2017 Go to the documentation of discoveryapis_generator 0.9.1+2 Download discoveryapis_generator 0.9.1+2 archive
0.9.1+1 Oct 5, 2017 Go to the documentation of discoveryapis_generator 0.9.1+1 Download discoveryapis_generator 0.9.1+1 archive

All 21 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
60
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
80
Learn more about scoring.

We analyzed this package on Aug 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.11.8

Platforms

Detected platforms: Flutter, other

Primary library: package:discoveryapis_generator/discoveryapis_generator.dart with components: io, isolate.

Suggestions

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 of the API.

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use discoveryapis_generator.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.22.0 <3.0.0
args >=0.12.1 <2.0.0 1.5.0
dart_style >=1.0.7 <=2.0.0 1.1.3
http >=0.11.1 <0.12.0 0.11.3+17
path >=1.3.3 <2.0.0 1.6.2
yaml >=2.0.0 <3.0.0 2.1.15
Transitive dependencies
analyzer 0.32.4
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.0.2
crypto 2.0.6
csslib 0.14.4+1
front_end 0.1.4
glob 1.1.7
html 0.13.3+2
http_parser 3.1.3
kernel 0.3.4
logging 0.11.3+2
meta 1.1.6
package_config 1.0.5
plugin 0.2.0+3
source_span 1.4.1
string_scanner 1.0.3
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
Dev dependencies
_discoveryapis_commons >=0.1.0 <0.2.0
test >0.12.0 <2.0.0