Giter Club home page Giter Club logo

discoveryapis_generator's Introduction

discoveryapis_generator's People

Contributors

adam-singer avatar close2 avatar crazywater avatar damondouglas avatar dani-gallegos avatar davidmorgan avatar devoncarew avatar enyo avatar floitschg avatar jakobr-google avatar jcollins-g avatar jonasfj avatar kevmoo avatar markbennett avatar mkustermann avatar natebosch avatar scarygami avatar sethladd avatar sgjesse avatar srawlins avatar timothyarmstrong avatar whesse avatar wibling avatar zboralski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

discoveryapis_generator's Issues

Devserver memory error when posting with the console client

Btw, POST works ok with the browser client. This could be a dev_server problem only.

Traceback (most recent call last): File "/home/d2m/workspace/appengine/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 1302, in communicate req.respond() File "/home/d2m/workspace/appengine/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 831, in respond self.server.gateway(self).respond() File "/home/d2m/workspace/appengine/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 2117, in respond for chunk in response: File "/home/d2m/workspace/appengine/google_appengine/google/appengine/tools/devappserver2/endpoints/endpoints_server.py", line 111, in __call__ request = api_request.ApiRequest(environ) File "/home/d2m/workspace/appengine/google_appengine/google/appengine/tools/devappserver2/endpoints/api_request.py", line 56, in __init__ self.body = environ['wsgi.input'].read() File "/home/d2m/workspace/appengine/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 440, in read data += self.buffer MemoryError

drive.files.list: Uncaught Error: APIRequestException: onError: AsyncError: 'HTTP error 400: Bad Request'

drive.files.list called with q:query leads to

Uncaught Error: APIRequestException: onError: AsyncError: 'HTTP error 400: Bad Request'
Stack trace:
#0      PubHttpClient.send.<anonymous closure>.<anonymous closure> (package:google_oauth2_client/src/console/oauth2_console_client/http.dart:58:9)
#1      _ThenFuture._sendValue (dart:async:381:24)


Unhandled exception:
APIRequestException: onError: AsyncError: 'HTTP error 400: Bad Request'
Stack trace:
#0      PubHttpClient.send.<anonymous closure>.<anonymous closure> (package:google_oauth2_client/src/console/oauth2_console_client/http.dart:58:9)
#1      _ThenFuture._sendValue (dart:async:381:24)


#0      _FutureImpl._scheduleUnhandledError.<anonymous closure> (dart:async:309:9)
#1      _Timer._createTimerHandler._handleTimeout (dart:io:7239:28)
#2      _Timer._createTimerHandler._handleTimeout (dart:io:7247:7)
#3      _Timer._createTimerHandler.<anonymous closure> (dart:io:7255:23)
#4      _ReceivePortImpl._handleMessage (dart:isolate-patch:40:92)

see full code at: https://github.com/damondouglas/google_drive_v2_api_examples/blob/master/console/files/list_files_example.dart

fromJson for data objects should handle error body

Just tried to use the API client without any auth. The response JSON was

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Login Required",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Login Required"
 }
}

But Buckets.fromJson in the generated storage lib just gave me an empty bucket out.

If there is no content, but there are errors, fromJson should likely throw?

Multiple markers at this line error with 'default' and 'enum'

Dart Editor analyzer throws the following error at the certain generated code locations.

Multiple markers at this line
    - Expected a class 
     member
    - Unexpected token 
     'default'
    - Unexpected token ';'

Here are the code lines that show the error:

  • discovery_v1 > common > schemas.dart:

    238  core.String default;
    
    244  core.List<core.String> enum;
    
    297  default = json["default"];
    
    303  enum = [];
    
    305  enum.add(item);
    
    365  if (default != null) {
    
    366  output["default"] = default;
    
    371  if (enum != null) {
    
    373  enum.forEach((item) {

    .

  • youtube_v3 > common > schemas.dart

    2944  core.String default;
    
    2952  default = json["default"];
    
    2966  if (default != null) {
    
    2967  output["default"] = default;
    
    4607  Thumbnail default;
    
    4616  default = new Thumbnail.fromJson(json["default"]);
    
    4636  if (default != null) {
    
    4637  output["default"] = default.toJson();
    

Proper handling of special types

See https://developers.google.com/discovery/v1/type-format

  • integer - uint32: enforce >= 0 && < 2^32 (4294967295)
  • string - uint64: enforce >= 0 && < 2^64
  • string - date: An RFC3339 date in the format YYYY-MM-DD. Defined in the JSON Schema spec.
  • string - date-time:An RFC3339 timestamp in UTC time. This is formatted as YYYY-MM-DDThh:mm:ss.fffZ. The milliseconds portion (".fff") is optional. Defined in the JSON Schema spec.
  • string - byte: A padded, base64-encoded string of bytes, encoded with a URL and filename safe alphabet (sometimes referred to as "web-safe" or "base64url"). Defined by RFC4648.
  • string - int64: enforce range and always string (currently I think an int value is sent over the wire, need to test)

The latest pub package of google_drive_v2_api uses ?content with is no longer supported.

Internal error: 'package:google_drive_v2_api/src/client/resources.dart': Error: line 802 pos 9: unexpected token '?'
if (?content && content != null) {

Is what dartvm is telling me when i try to insert a file to drive.
When i change the line to if (content != null) { it all works fine i think.

If this is already fixed please make a new pub package for google_drive_v2_api.

Release 0.4.x - 1

https://gist.github.com/financeCoding/7104303

Completed Summary
COMPLETED: adexchangebuyer, v1, dart_adexchangebuyer_v1_api_client
COMPLETED: adexchangebuyer, v1.1, dart_adexchangebuyer_v1_1_api_client
COMPLETED: adexchangebuyer, v1.2, dart_adexchangebuyer_v1_2_api_client
COMPLETED: adexchangebuyer, v1.3, dart_adexchangebuyer_v1_3_api_client
COMPLETED: adexchangeseller, v1, dart_adexchangeseller_v1_api_client
COMPLETED: adexchangeseller, v1.1, dart_adexchangeseller_v1_1_api_client
COMPLETED: admin, directory_v1, dart_admin_directory_v1_api_client
COMPLETED: admin, email_migration_v2, dart_admin_email_migration_v2_api_client
COMPLETED: admin, reports_v1, dart_admin_reports_v1_api_client
COMPLETED: adsense, v1.2, dart_adsense_v1_2_api_client
COMPLETED: adsense, v1.3, dart_adsense_v1_3_api_client
COMPLETED: adsensehost, v4.1, dart_adsensehost_v4_1_api_client
COMPLETED: analytics, v2.4, dart_analytics_v2_4_api_client
COMPLETED: analytics, v3, dart_analytics_v3_api_client
COMPLETED: androidpublisher, v1, dart_androidpublisher_v1_api_client
COMPLETED: androidpublisher, v1.1, dart_androidpublisher_v1_1_api_client
COMPLETED: appstate, v1, dart_appstate_v1_api_client
COMPLETED: audit, v1, dart_audit_v1_api_client
COMPLETED: bigquery, v2, dart_bigquery_v2_api_client
COMPLETED: blogger, v2, dart_blogger_v2_api_client
COMPLETED: blogger, v3, dart_blogger_v3_api_client
COMPLETED: books, v1, dart_books_v1_api_client
COMPLETED: calendar, v3, dart_calendar_v3_api_client
COMPLETED: civicinfo, us_v1, dart_civicinfo_us_v1_api_client
COMPLETED: compute, v1beta15, dart_compute_v1beta15_api_client
COMPLETED: compute, v1beta16, dart_compute_v1beta16_api_client
COMPLETED: coordinate, v1, dart_coordinate_v1_api_client
COMPLETED: customsearch, v1, dart_customsearch_v1_api_client
COMPLETED: datastore, v1beta1, dart_datastore_v1beta1_api_client
COMPLETED: datastore, v1beta2, dart_datastore_v1beta2_api_client
COMPLETED: dfareporting, v1, dart_dfareporting_v1_api_client
COMPLETED: dfareporting, v1.1, dart_dfareporting_v1_1_api_client
COMPLETED: dfareporting, v1.2, dart_dfareporting_v1_2_api_client
COMPLETED: dfareporting, v1.3, dart_dfareporting_v1_3_api_client
COMPLETED: discovery, v1, dart_discovery_v1_api_client
COMPLETED: doubleclickbidmanager, v1, dart_doubleclickbidmanager_v1_api_client
COMPLETED: doubleclicksearch, v2, dart_doubleclicksearch_v2_api_client
COMPLETED: drive, v1, dart_drive_v1_api_client
COMPLETED: drive, v2, dart_drive_v2_api_client
COMPLETED: freebase, v1-sandbox, dart_freebase_v1_sandbox_api_client
COMPLETED: freebase, v1sandbox, dart_freebase_v1sandbox_api_client
COMPLETED: freebase, v1, dart_freebase_v1_api_client
COMPLETED: fusiontables, v1, dart_fusiontables_v1_api_client
COMPLETED: games, v1, dart_games_v1_api_client
COMPLETED: gamesManagement, v1management, dart_gamesmanagement_v1management_api_client
COMPLETED: gan, v1beta1, dart_gan_v1beta1_api_client
COMPLETED: groupsmigration, v1, dart_groupsmigration_v1_api_client
COMPLETED: groupssettings, v1, dart_groupssettings_v1_api_client
COMPLETED: identitytoolkit, v3, dart_identitytoolkit_v3_api_client
COMPLETED: licensing, v1, dart_licensing_v1_api_client
COMPLETED: mirror, v1, dart_mirror_v1_api_client
COMPLETED: oauth2, v1, dart_oauth2_v1_api_client
COMPLETED: oauth2, v2, dart_oauth2_v2_api_client
COMPLETED: orkut, v2, dart_orkut_v2_api_client
COMPLETED: pagespeedonline, v1, dart_pagespeedonline_v1_api_client
COMPLETED: plus, v1, dart_plus_v1_api_client
COMPLETED: plusDomains, v1, dart_plusdomains_v1_api_client
COMPLETED: prediction, v1.2, dart_prediction_v1_2_api_client
COMPLETED: prediction, v1.3, dart_prediction_v1_3_api_client
COMPLETED: prediction, v1.4, dart_prediction_v1_4_api_client
COMPLETED: prediction, v1.5, dart_prediction_v1_5_api_client
COMPLETED: prediction, v1.6, dart_prediction_v1_6_api_client
COMPLETED: reseller, v1sandbox, dart_reseller_v1sandbox_api_client
COMPLETED: reseller, v1, dart_reseller_v1_api_client
COMPLETED: shopping, v1, dart_shopping_v1_api_client
COMPLETED: siteVerification, v1, dart_siteverification_v1_api_client
COMPLETED: sqladmin, v1beta1, dart_sqladmin_v1beta1_api_client
COMPLETED: storage, v1beta1, dart_storage_v1beta1_api_client
COMPLETED: storage, v1beta2, dart_storage_v1beta2_api_client
COMPLETED: taskqueue, v1beta1, dart_taskqueue_v1beta1_api_client
COMPLETED: taskqueue, v1beta2, dart_taskqueue_v1beta2_api_client
COMPLETED: tasks, v1, dart_tasks_v1_api_client
COMPLETED: translate, v2, dart_translate_v2_api_client
COMPLETED: urlshortener, v1, dart_urlshortener_v1_api_client
COMPLETED: webfonts, v1, dart_webfonts_v1_api_client
COMPLETED: youtube, v3, dart_youtube_v3_api_client
COMPLETED: youtubeAnalytics, v1, dart_youtubeanalytics_v1_api_client
COMPLETED: youtubeAnalytics, v1beta1, dart_youtubeanalytics_v1beta1_api_client

Repeated parameter for get requests

Is there a way to provide repeated parameters with a generated client which is sending get requests?

Let my explain it with an real world example:

In my Backend I defined my Message which can contain a list of Strings

class ChangesRequestMessage(messages.Message):
    known_ids = messages.StringField(1, repeated=True)

In my endpoint declaration I'm using get and list which is quite similar to the Google Apis:

@endpoints.method(ChangesRequestMessage, ChangesMessage,
    path='changes', http_method='GET',
    name='changes.list')

A working request in the API explorer looks like this:

GET http://localhost:80/_ah/api/blossom/0_0_0/changes?known_ids=foo&known_ids=bar

The generated client method is:

async.Future<ApiMessagesChangesMessage> list({core.String known_ids, core.String since, core.Map optParams})

The known_ids is a single String, which I can't provide with known_ids=foo&known_ids=bar since it will get URI encoded. Neither can I provide an Iterable.

From my gut feeling I would propose to also generate ApiMessage classes for get requests as well. Accepting an Iterable instead of an single String would work as well here.
What do you guys think?

Stop exporting the base client library from console/browser library

Thought: it is likely nice if I can write a library on top of a Google API that is agnostic to browser vs client.

Sadly, when Browser (for example) imports and exports the core Client library, if someone else codes directly to the core library, the analyzer will yell about type incompatibility...

...also, we should likely put the core client library back at the top level (and not under the src dir).

Thoughts? @financecoding @Scarygami

package:js generate huge javascript output

References:

https://github.com/dart-lang/js-interop/issues/113

https://code.google.com/p/dart/issues/detail?id=12730

with minify:

2.6M out/web/index.html_bootstrap.dart.js
3.2M out/web/index.html_bootstrap.dart.precompiled.js

without minify:

5.1M out/web/index.html_bootstrap.dart.js
6.4M out/web/index.html_bootstrap.dart.precompiled.js

This quick hack works in Dartium but breaks the dart2js output
However it solves the size problem:

$ du -ah out/web/*js
344K    out/web/index.html_bootstrap.dart.js
524K    out/web/index.html_bootstrap.dart.precompiled.js
diff --git a/lib/src/generator.dart b/lib/src/generator.dart
index 6b91f83..bc6b7c0 100644
--- a/lib/src/generator.dart
+++ b/lib/src/generator.dart
@@ -489,7 +489,7 @@ class DetailedApiRequestError extends Error {
 import "dart:async";
 import "dart:html" as html;
 import "dart:convert";
-import "package:js/js.dart" as js;
+import "dart:js" as js;
 import "package:google_oauth2_client/google_oauth2_browser.dart" as oauth;

 import 'client_base.dart';

This is the output of dart2js:

out/web/packages/path/path.dart:49:23: Hint: Can't find 'dart.io.Directory.current' in the current library.
Did you forget to add an import?
@MirrorsUsed(targets: 'dart.dom.html.window, '
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
out/web/packages/path/path.dart:49:23: Hint: Can't find 'dart.io.Platform.operatingSystem' in the current library.
Did you forget to add an import?
@MirrorsUsed(targets: 'dart.dom.html.window, '
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
out/web/index.html_bootstrap.dart:15:3: Warning: 'i2' has no member named 'main'.
  i2.main();
  ^^^^^^^^^
out/web/packages/template_binding/src/element.dart:18:7: Warning: No member named 'attributes' in class 'Node'.
      _node.attributes.remove(name);
      ^^^^^^^^^^^^^^^^
out/web/packages/belua_v1_api/src/browser_client.dart:69:5: Warning: 'js' has no member named 'scoped'.
    js.scoped(() {
    ^^^^^^^^^^^^^^^
out/web/packages/belua_v1_api/src/browser_client.dart:70:61: Warning: 'js' has no member named 'map'.
      var request = js.context["gapi"]["client"]["request"](js.map(requestData));
                                                            ^^^^^^^^^^^^^^^^^^^
out/web/packages/belua_v1_api/src/browser_client.dart:71:29: Warning: Cannot resolve 'Callback'.
      var callback = new js.Callback.once((jsonResp, rawResp) {
                            ^^^^^^^^
out/web/packages/belua_v1_api/src/browser_client.dart:32:5: Warning: 'js' has no member named 'scoped'.
    js.scoped((){
    ^^^^^^^^^^^^^^
out/web/packages/belua_v1_api/src/browser_client.dart:33:43: Warning: Cannot resolve 'Callback'.
      js.context[_corsCallback] =  new js.Callback.once(() {
                                          ^^^^^^^^
out/web/index.html_bootstrap.dart:1:1: Hint: 1373 methods retained for use by dart:mirrors out of 2044 total methods (67%).
library app_bootstrap;

I'll take a closer look tomorrow.

--full option overwrites directories

I noticed when running with --full argument, it deletes a directory then creates a library directory. I'm going to try to fix the directory cleaning so it does it only once prior to building the libraries.

$ dart bin/generate.dart --full
Emptying folder before library generation.
Library groupsmigration_v1_api_client generated successfully.
Emptying folder before library generation.
Library oauth2_v1_api_client generated successfully.
Emptying folder before library generation.
Library adexchangebuyer_v1_api_client generated successfully.
Emptying folder before library generation.
Library androidpublisher_v1_api_client generated successfully.
Emptying folder before library generation.
Library translate_v2_api_client generated successfully.
Emptying folder before library generation.
Library drive_v1_api_client generated successfully.
Emptying folder before library generation.
Library adexchangebuyer_v1_1_api_client generated successfully.
Emptying folder before library generation.
Library youtubeanalytics_v1_api_client generated successfully.
Emptying folder before library generation.
Library groupssettings_v1_api_client generated successfully.
Emptying folder before library generation.
Library taskqueue_v1beta1_api_client generated successfully.
Emptying folder before library generation.
Library webfonts_v1_api_client generated successfully.
Emptying folder before library generation.
Library adsense_v1_api_client generated successfully.
Emptying folder before library generation.
Library adsense_v1_1_api_client generated successfully.
Emptying folder before library generation.
Library adexchangeseller_v1_api_client generated successfully.
Emptying folder before library generation.
Library analytics_v2_4_api_client generated successfully.
Emptying folder before library generation.
Library oauth2_v2_api_client generated successfully.
Emptying folder before library generation.
Library youtubeanalytics_v1beta1_api_client generated successfully.
Emptying folder before library generation.
Library freebase_v1_api_client generated successfully.
Emptying folder before library generation.
Library licensing_v1_api_client generated successfully.
Emptying folder before library generation.
Library adexchangebuyer_v1_2_api_client generated successfully.
Emptying folder before library generation.
Library blogger_v2_api_client generated successfully.
Emptying folder before library generation.
Library dfareporting_v1_1_api_client generated successfully.
Emptying folder before library generation.
Library latitude_v1_api_client generated successfully.
Emptying folder before library generation.
Library audit_v1_api_client generated successfully.
Emptying folder before library generation.
Library blogger_v3_api_client generated successfully.
Emptying folder before library generation.
Library prediction_v1_2_api_client generated successfully.
Emptying folder before library generation.
Library mirror_v1_api_client generated successfully.
Emptying folder before library generation.
Library freebase_v1sandbox_api_client generated successfully.
Emptying folder before library generation.
Library customsearch_v1_api_client generated successfully.
Emptying folder before library generation.
Library reseller_v1sandbox_api_client generated successfully.
Emptying folder before library generation.
Library civicinfo_us_v1_api_client generated successfully.
Emptying folder before library generation.
Library siteverification_v1_api_client generated successfully.
Emptying folder before library generation.
Library prediction_v1_3_api_client generated successfully.
Emptying folder before library generation.
Library prediction_v1_4_api_client generated successfully.
Emptying folder before library generation.
Library urlshortener_v1_api_client generated successfully.
Emptying folder before library generation.
Library dfareporting_v1_api_client generated successfully.
Emptying folder before library generation.
Library coordinate_v1_api_client generated successfully.
Emptying folder before library generation.
Library fusiontables_v1_api_client generated successfully.
Emptying folder before library generation.
Library drive_v2_api_client generated successfully.
Emptying folder before library generation.
Library orkut_v2_api_client generated successfully.
Emptying folder before library generation.
Library tasks_v1_api_client generated successfully.
Emptying folder before library generation.
Library pagespeedonline_v1_api_client generated successfully.
Emptying folder before library generation.
Library prediction_v1_5_api_client generated successfully.
Emptying folder before library generation.
Library reseller_v1_api_client generated successfully.
Emptying folder before library generation.
Library taskqueue_v1beta2_api_client generated successfully.
Emptying folder before library generation.
Library compute_v1beta13_api_client generated successfully.
Emptying folder before library generation.
Library adsensehost_v4_1_api_client generated successfully.
Emptying folder before library generation.
Library shopping_v1_api_client generated successfully.
Emptying folder before library generation.
Library storage_v1beta1_api_client generated successfully.
Emptying folder before library generation.
Library plus_v1_api_client generated successfully.
Emptying folder before library generation.
Library adsense_v1_2_api_client generated successfully.
Emptying folder before library generation.
Library bigquery_v2_api_client generated successfully.
Emptying folder before library generation.
Library compute_v1beta14_api_client generated successfully.
Emptying folder before library generation.
Library analytics_v3_api_client generated successfully.
Emptying folder before library generation.
Library gan_v1beta1_api_client generated successfully.
Emptying folder before library generation.
Library youtube_v3_api_client generated successfully.
Emptying folder before library generation.
Library discovery_v1_api_client generated successfully.
Emptying folder before library generation.
Library books_v1_api_client generated successfully.
Emptying folder before library generation.
Library calendar_v3_api_client generated successfully.

method not found: 'drive'

var request = drive.files.insert(file).then((drivelib.File f){
    file = f;
  });

from google_drive_v2_api_examples/console/files/get_example.dart yielded the following exception:

$ dart console/files/get_example.dart
    Unhandled exception:
    NoSuchMethodError : method not found: 'drive'
    Receiver: Type: class '::'
    Arguments: []

Dart Version:

Dart VM version: 0.3.4.0_r18115 (Tue Feb  5 05:51:07 2013)

Equal name for package name and directory

I get different names for the directory and the package defined in the pubspec.yaml. I think it makes that both are the same. If you agree I would start working on a pull request.

When I run:
dart bin/generate.dart --url=http://localhost/_ah/api/discovery/v1/apis/blossom/0_0_0/rest --output test_ouput/

I get:
package directory name: dart_blossom_0_0_0_api_client
name in pubspec.yaml: google_blossom_0_0_0_api

cheers
Nik

Build from rpc discovery url

Could be this is a problem on my end, but using the RPC discovery Url builds fine but blows up on the client end.

I have not found a mention in the source or docs that the REST discovery url is mandatory.

Naming collision

Hey guys,

Looks like there might be a naming collision with resources and some of Dart's core types; for example here: https://github.com/dart-google-apis/dart_prediction_v1_5_api_client/blob/master/lib/src/common/schemas.dart#L620

The way that Google's existing generator handles this is by prefixing the core types. You can actually do this with:

import 'dart:core' as core;

and then prefix everything, i.e.:

var l = new core.List<core.String>();
l.add('something');
core.print(l[0]);

It's a bit ugly, but it's a potential solution.

drives.files.trash and untrash: Uncaught Error: POST error: SocketIOException: SecureSocket error (NoSuchMethodError : method not found: 'length'

both drives.files.trash and untrash yields the following exception:

Uncaught Error: APIRequestException: POST error: SocketIOException: SecureSocket error (NoSuchMethodError : method not found: 'length'
Receiver: null
Arguments: [])
Unhandled exception:
APIRequestException: POST error: SocketIOException: SecureSocket error (NoSuchMethodError : method not found: 'length'
Receiver: null
Arguments: [])
#0      _FutureImpl._scheduleUnhandledError.<anonymous closure> (dart:async:309:9)
#1      _Timer._createTimerHandler._handleTimeout (dart:io:7239:28)
#2      _Timer._createTimerHandler._handleTimeout (dart:io:7247:7)
#3      _Timer._createTimerHandler.<anonymous closure> (dart:io:7255:23)
#4      _ReceivePortImpl._handleMessage (dart:isolate-patch:40:92)

full code may be found at:

Generating deprecated code with JS package

I think this error that I get from google_plus_v1_api actually stems from generated code?

Apologies if not.

      ^^^^^^^^^^^^^^
out/web/packages/google_plus_v1_api/src/browser_client.dart:69:5: Warning: 'js' has no member named 'scoped'.
    js.scoped(() {
    ^^^^^^^^^^^^^^^
out/web/packages/google_plus_v1_api/src/browser_client.dart:71:29: Warning: Cannot resolve 'Callback'.
      var callback = new js.Callback.once((jsonResp, rawResp) {
                            ^^^^^^^^
out/web/packages/google_plus_v1_api/src/browser_client.dart:32:5: Warning: 'js' has no member named 'scoped'.
    js.scoped((){
    ^^^^^^^^^^^^^^
out/web/packages/google_plus_v1_api/src/browser_client.dart:33:43: Warning: Cannot resolve 'Callback'.
      js.context[_corsCallback] =  new js.Callback.once(() {

The built-in library 'dart:json' is not available on the stand-alone VM.

pubspec.yaml depends on google_discovery_v1_api: 0.3.8 which still uses dart:json.

$ dart $GENERATE_DART --no-prefix -i $API_JSON -o .
The built-in library 'dart:json' is not available on the stand-alone VM.
'package:google_discovery_v1_api/discovery_v1_api_client.dart': Error: line 5 pos 1: library handler failed
import "dart:json" as JSON;
^
'package:discovery_api_client_generator/generator.dart': Error: line 7 pos 1: library handler failed
import 'package:google_discovery_v1_api/discovery_v1_api_client.dart';

drive.files.touch: Uncaught Error: APIRequestException: onError: AsyncError: 'HTTP error 400: Bad Request'

drive.files.touch yields the following exception:

Uncaught Error: APIRequestException: onError: AsyncError: 'HTTP error 400: Bad Request'
Stack trace:
#0      PubHttpClient.send.<anonymous closure>.<anonymous closure> (package:google_oauth2_client/src/console/oauth2_console_client/http.dart:58:9)
#1      _ThenFuture._sendValue (dart:async:381:24)


Unhandled exception:
APIRequestException: onError: AsyncError: 'HTTP error 400: Bad Request'
Stack trace:
#0      PubHttpClient.send.<anonymous closure>.<anonymous closure> (package:google_oauth2_client/src/console/oauth2_console_client/http.dart:58:9)
#1      _ThenFuture._sendValue (dart:async:381:24)


#0      _FutureImpl._scheduleUnhandledError.<anonymous closure> (dart:async:309:9)
#1      _Timer._createTimerHandler._handleTimeout (dart:io:7239:28)
#2      _Timer._createTimerHandler._handleTimeout (dart:io:7247:7)
#3      _Timer._createTimerHandler.<anonymous closure> (dart:io:7255:23)
#4      _ReceivePortImpl._handleMessage (dart:isolate-patch:40:92)

see full code at: https://github.com/damondouglas/google_drive_v2_api_examples/blob/master/console/files/touch_file_example.dart

Expose typed constructors for resources

Unless I missed something, it looks like the only way to create resources is via fromJson. For instance for the plus API v1, it looks like the only way to create a Moment is via

Moment.fromJson(core.Map json)

It would be cool to alternatively be able to create a moment via

Moment(String id, 
       ItemScope result, 
       String startDate, 
       ItemScope target, 
       String type)

for instance (optional arguments could be optional).

Console Examples Hang

The following console examples hang and need Ctrl C to break in the terminal. I suspect it might have something to do with drive.files.get as both the copy_example and get_example call this method. I'm not sure what would be common in the list_example that also causes it to hang.

  1. copy_example.dart
  2. get_example.dart
  3. list_example.dart

Class already defined error in translate_v2 API

In generated API, translate_v2 > common > resources.dart, Dart Editor analyzer shows error The name <class> is already defined:

3   class DetectionsResource extends Resource {

46  class LanguagesResource extends Resource { 

88  class TranslationsResource extends Resource {

Creating hop support generated for each library

Sorry this is more a Milestone than an issue. Please feel free to close this and convert it to one as I didn't have access to create Milestones. I'm modifying generator.dart to build a tool/hop_runner.dart for each library that analyzes its own code and builds its own dart documentation. Once done, I'm going to analyze each generated library to make sure no errors or warnings appear. This might take a while, but I want to be thorough about it. I wish there was a way I can automatically generate test/example cases as well.

siteVerification will produce a warning with naming convention

I think we can live with this issue, but pub warns of in proper naming convention.

WARN: Suggestions:
WARN: * Package name "google_siteVerification_v1_api" should be lower-case. Maybe use "google_site_verification_v1_api"?
WARN: * The name of "lib/siteVerification_v1_api_browser.dart", "siteVerification_v1_api_browser", should be lower-case. Maybe use "site_verification_v1_api_browser"?
WARN: * The name of "lib/siteVerification_v1_api_client.dart", "siteVerification_v1_api_client", should be lower-case. Maybe use "site_verification_v1_api_client"?
WARN: * The name of "lib/siteVerification_v1_api_console.dart", "siteVerification_v1_api_console", should be lower-case. Maybe use "site_verification_v1_api_console"?

APIRequestException

This error in the dart client app came up after updating to latest generator version

Uncaught Error: APIRequestException: 400 modifiedSince value should never be accessed.
Exception: APIRequestException: 400 modifiedSince value should never be accessed.

Appengine 1.8.2 on localhost

How I'm supposed to use this package?

I added the package to the pubspec specification and run pub install. In this case I only got the library without the bin.

I could add it as a git submodule to our repository, but I would rather like to use the Dart package management if possible.

Do you have any other ideas?

Js code doesn't visit cloud endpoint if using web ui

If you create a project using web ui and then including the cloud endpoint dart client library, the project works well in Dart code but once convert to js, the js never visits the cloud endpoint.

how to recreate:
1, use the https://github.com/Scarygami/gdg-endpoint-demo to build the server; change the app id and client id ;
2, use this generator to generate the cloud endpoint dart client;

3, create a dart project , named demo (NOT use web ui), use the https://github.com/Scarygami/gdg-endpoint-demo/tree/master/dart_gdgdemo_v1_api_client/example replace the automatic generated files; change the client id in the demo.dart to match the (1);
4, run using dart code and js code; check the app engine server log to confirm it the code visit the server; (in both scenarios, the dart and js code visit the server)

5, create another dart project , named demo (use web ui), use the https://github.com/Scarygami/gdg-endpoint-demo/tree/master/dart_gdgdemo_v1_api_client/example replace the automatic generated files;change the client id in the demo.dart to match the (1);

6,run using dart code and js code; check the app engine server log to confirm it the code visit the server; (dart code will visit the server while the js code not)

Creating hop support generated for each library

Sorry this is more a Milestone than an issue. Please feel free to close this and convert it to one as I didn't have access to create Milestones. I'm modifying generator.dart to build a tool/hop_runner.dart for each library that analyzes its own code and builds its own dart documentation. Once done, I'm going to analyze each generated library to make sure no errors or warnings appear. This might take a while, but I want to be thorough about it. I wish there was a way I can automatically generate test/example cases as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.