Comments (8)
Note: The command did include the api_name: "myapi".
from apis-client-generator.
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.
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.
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.
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.
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.
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.
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)
- Generated Java model class misses toString()
- Document Django <=1.8 requirement HOT 6
- Update or delete pip package HOT 3
- C++: implementations of some functions are not generated. HOT 1
- Optional Query Params Not Generated for Method Call Params
- Top level list in discovery document are not generated correctly
- PSR compliance PHP client generator HOT 2
- Generating c++ fails. HOT 2
- Generating C++ fails
- Recommended way for generating clients? HOT 2
- Last release to PIP was 2013-08-20. Make new release HOT 4
- Broken code generated using master on Java target HOT 7
- Unable to locally deploy generated Java client with Maven
- PHP generated classes dont have a namespace in them
- PHPApi in php_generator.py does not strip out spaces from api class name
- Allow Django version above > 1.11.19 HOT 2
- Getting issue of name
- Support for python3 HOT 5
- DCM API Migration Issue
- Incompatible with google-api-client:2.0.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apis-client-generator.