GithubHelp home page GithubHelp logo

Comments (8)

tmst avatar tmst commented on May 18, 2024

Note: The command did include the api_name: "myapi".

from apis-client-generator.

aiuto avatar aiuto commented on May 18, 2024

Do not include --api_name and --api_version. Just use --input=myapi.json. It picks up the api name and version from the discovery file.

from apis-client-generator.

tmst avatar tmst commented on May 18, 2024

When I don't include --api_name and --api_version, errors are reported that
they are absent:

super(DartApi, self).init(discovery_doc)
File "/usr/lib/python2.7/site-packages/googleapis/codegen/api.py", line 103,
in init
wire_name=discovery_doc['name'])
KeyError: 'name'

When I include "name" and "version" at the top level of the discovery document
(and run without --api_name and --api_version), the script completes without
error but doesn't output anything into the specified directory.

On Monday 30 March 2015 06:18:58 AM aiuto wrote:

Do not include --api_name and --api_version. Just use --input=myapi.json.
It picks up the api name and version from the discovery file.


Reply to this email directly or view it on GitHub:
#11 (comment)
517

from apis-client-generator.

aiuto avatar aiuto commented on May 18, 2024

How did you get that discovery file, from the Google cloud tools or hand built?
If from the google tools, that might be a problem in the discovery generator for Cloud Endpoints. If you hand built it, then you should include name and id. Take a look at some examples (e.g.
https://www.googleapis.com/discovery/v1/apis/discovery/v1/rest)

You need, almost everything up to parameters. Add ownerDomain and ownerName so the libraries come out namespaced correctly for your use.

from apis-client-generator.

tmst avatar tmst commented on May 18, 2024

It's the discovery doc generated in Google cloud tools and published at appspot.com.

The example above is very much longer than the one published for my API, which is only 36 lines!

I'm now getting the following:
NoSuchMethodError: method not found: 'toLowerCase'

from apis-client-generator.

aiuto avatar aiuto commented on May 18, 2024

I can not reproduce with the current source. Is your copy stale? Can you attache a sanitized copy of the discovery?

from apis-client-generator.

tmst avatar tmst commented on May 18, 2024

I can't tell what version of this package I'm using but it was cloned 2 days ago. Here's a copy of the sanitized discovery document:

{
"kind": "discovery#directoryList",
"discoveryVersion": "v1",
"items": [
{
"kind": "discovery#directoryItem",
"id": "discovery:v1",
"name": "discovery",
"version": "v1",
"title": "APIs Discovery Service",
"description": "Lets you discover information about other Google APIs, such as what APIs are available, the resource and method details for each API.",
"discoveryRestUrl": "https://sanitized.appspot.com/_ah/api/discovery/v1/apis/discovery/v1/rest",
"discoveryLink": "./apis/discovery/v1/rest",
"icons": {
"x16": "http://www.google.com/images/icons/feature/filing_cabinet_search-g16.png",
"x32": "http://www.google.com/images/icons/feature/filing_cabinet_search-g32.png"
},
"documentationLink": "https://developers.google.com/discovery/",
"preferred": true
},
{
"kind": "discovery#directoryItem",
"id": "sanitized:v1",
"name": "sanitized",
"version": "v1",
"description": "Ferris-based sanitized API",
"discoveryRestUrl": "https://sanitized.appspot.com/_ah/api/discovery/v1/apis/sanitized/v1/rest",
"discoveryLink": "./apis/sanitized/v1/rest",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"preferred": true
}
]
}

from apis-client-generator.

tmst avatar tmst commented on May 18, 2024

I just fired up the development server and discovered that there are (at least) two versions of the discovery document for a given API - one published on localhost and the other at the appspot.com domain. The one on localhost is much longer and more complete.

from apis-client-generator.

Related Issues (20)

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.