apigee-127 / a127-documentation Goto Github PK
View Code? Open in Web Editor NEWDocumentation for Apigee-127
Documentation for Apigee-127
need content for the npm page: https://www.npmjs.org/package/swagger-editor-for-apigee-127
I have followed step by step instructions and every output came as expected.but not able to login to Usergrid portal in Ubuntu 14.04 either with superuser/superuser or test/test.And its giving Error: the username / password combination was not valid even with correct credentials.
Hi
I tried installing this as sudo on OSX but it failed as it couldn't create the folder .a127 in my home directory.
Solution was to add the unsafe flag --unsafe-perm
Documentation should be modified to mention that as follows:
sudo npm install -g apigee-127 --unsafe-perm
I'm guessing I've missed something silly so I apologize in advance.
I'm trying to run the example found at the following URL in mock mode: https://github.com/apigee-127/a127-samples/blob/master/weather-basic/api/swagger/swagger.yaml
The JSON response looks like it's being escaped and it's causing the response validator to fail:
{
"message": "Response validation failed: invalid content type (text/plain). These are valid: application/json",
"failedValidation": true,
"originalResponse": "{\"base\":\"Sample text\",\"clouds\":{\"all\":1},\"cod\":1,\"coord\":{\"lat\":1,\"lon\":1},\"dt\":1,\"id\":1,\"main\":{\"humidity\":1,\"pressure\":1,\"temp_max\":1,\"temp_min\":1,\"temp\":1},\"name\":\"Sample text\",\"sys\":{\"country\":\"Sample text\",\"id\":1,\"message\":1,\"sunrise\":1,\"sunset\":1,\"type\":1},\"weather\":[{\"description\":\"Sample text\",\"icon\":\"Sample text\",\"id\":1,\"main\":\"Sample text\"}],\"wind\":{\"deg\":1,\"speed\":1}}"
}
Any ideas would be awesome!
On https://github.com/apigee-127/a127-documentation it seems that the vimeocdn links are direct to the video on the CDN instead of the vimeo page, it seems those links expire.
I am trying out a127/volos and I have a question about the best way to show the swagger ui from the swagger yaml file that is edited in the a127 generated project. I am new to swagger and a127/volos so forgive me if I am asking a dumb question.
I was thinking that I could have my api project (which was generated with a127) serve up a swagger.json file that swagger ui could display. I see that a127 generates and edits the swagger.yaml file in the project. I was wondering how I would go about serving that up from the running api to swagger ui. As far as I know, swagger ui takes a json file not a yaml file.
Down the road, I thought that I could create a dev portal that could point at the api to get the swagger doc to display and allow the user to exercise the api from the swagger ui.
Any help or direction you can point me in would be helpful. I was on a previous project using node and express but I am far from an expert on express.
Thanks!!!
...Ed
How to validate the response from a controller with the API specs in a yaml file?
.pipe(tar.Extract({ path: directory }))
^
TypeError: tar.Extract is not a function
at inflate (/usr/lib/node_modules/apigee-127/node_modules/usergrid-installer/lib/download.js:133:15)
at /usr/lib/node_modules/apigee-127/node_modules/usergrid-installer/lib/download.js:77:5
at /usr/lib/node_modules/apigee-127/node_modules/usergrid-installer/lib/download.js:123:11
at FSReqWrap.oncomplete (fs.js:114:15)
The New tar seems to not have the needed function could you restrict ist to the 2 Version ?
I am having trouble getting apikey security to work when deployed to Apigee.
I have it working using a remote proxy on my machine using the customerKey in APigee for my remote proxy.
When I deploy to Apigee, the apikey security still works if I use the customerKey for my remote proxy. I am confused as how to configure things so that it will use the customerKey for a product that contains my API (instead of the remote proxy customerKey).
Here is what is in my swagger file for x-a127-config and x-a127-service:
x-a127-config:
remote.key: &apigeeProxyKey CONFIGURED
remote.uri: &apigeeProxyUri CONFIGURED
oauthProvider: &oauthProvider CONFIGURED
synergyUri: &synergyUri CONFIGURED
synergyApiKey: &synergyApiKey CONFIGURED
x-a127-services:
apiKeyHeaderSecurity:
provider: *oauthProvider
options:
uri: *apigeeProxyUri
key: *apigeeProxyKey
apiKeyQuerySecurity:
provider: *oauthProvider
options:
uri: *apigeeProxyUri
key: *apigeeProxyKey
Please let me know if there is anything else I should be telling you about my code.
Is there some other configuration that I need to do to get my app to use the customerKey defined for the app when it is deployed to Apigee?
Thanks for your help,
...Ed
When exercising hellow-world swagger editor, the swagger UI panel on the right seems to have issues invoking specified operations.
To reproduce:
1 create a new hello-world project using a127 project create
2 start and edit said project
3 update "host: localhost", append port on which hello-world is running
4 in the editor, click on try this, enter the name parameter
4.1 notice how the request is missing hello context (i.e. http://localhost:10010/?name=foo instead of http://localhost:10010/hello?name=foo)
I am on Mac OS X Yosemite 10.10.1. I downloaded apigee-127 npm install -g apigee-127
, then downloaded usergrid a127 usergrid download
. When I then try to start usergrid, I get the following error message:
$ sudo a127 usergrid start
starting...
.timeout
failed to start. Log tail:
Error: Invalid or corrupt jarfile /Users/cwarny/.a127/usergrid/usergrid-launcher-0.0.29.jar
Not able to start usergrid, get below error on my windows 7 m/c; pls suggest resolution/ workround
starting...
timeout
failed to start. Log tail:
INFO: Registering Spring bean, rootResource, of type org.apache.usergrid.rest.Ro
otResource as a root resource class
May 02, 2017 11:04:45 PM com.sun.jersey.spi.spring.container.SpringComponentProv
iderFactory registerSpringBeans
INFO: Registering Spring bean, systemResource, of type org.apache.usergrid.rest.
SystemResource as a root resource class
May 02, 2017 11:04:45 PM com.sun.jersey.spi.spring.container.SpringComponentProv
iderFactory registerSpringBeans
INFO: Registering Spring bean, propertiesResource, of type org.apache.usergrid.r
est.test.PropertiesResource as a root resource class
May 02, 2017 11:04:45 PM com.sun.jersey.server.impl.application.WebApplicationIm
pl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.18 11/22/2013 01:21 AM'
May 02, 2017 11:04:46 PM org.glassfish.grizzly.http.server.HttpServer start
INFO: [HttpServer] Started.
when tried to start portal, it gives error that "Usergrid isn't running.."
when tried to restart grid, get below error msg
Error: Port 8080 in use. Stop Usergrid process (or other process using port) and
try again.
at C:\SDB\Software\nodejs\node_modules\apigee-127\lib\commands\service\userg
rid.js:133:17
at C:\SDB\Software\nodejs\node_modules\apigee-127\node_modules\lodash\index.
js:7363:25
at Socket. (C:\SDB\Software\nodejs\node_modules\apigee-127\lib\ut
il\net.js:51:5)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:86:13)
at Socket.emit (events.js:188:7)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1084:10)
when tried to kill process using 8080 and restart usergrid, get same error as first error above..
I am trying to load environment configuration files, but neither my default.yaml
nor my newly added dev.yaml
are being loaded, I am using webstorm and added environment variable NODE_ENV=dev
, I also tried it from commandline node app.js NODE_ENV=dev
, also a127 project start NODE_ENV=dev
, also tried a127 project start dev
.
Nothing is working, the code req.config.varName
and req.config
are both returning undefined
from inside the controllers , I tried switching NODE_ENV off (should load default.yaml by default) but it is also returning undefined. below is my app.js
'use strict';
var a127 = require('a127-magic');
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.use(express.bodyParser());
module.exports = app; // for testing
// initialize a127 framework
a127.init(function(config) {
// include a127 middleware
app.use(a127.middleware(config));
var magic = config['a127.magic'];
config.basePath = magic.swaggerObject.basePath;
config.ui ={
swaggerUi: config.basePath + "/ui",
apiDocs: config.basePath + "/spec"
};
app.use(config['a127.magic'].swaggerTools.swaggerUi(config.ui));
// error handler to emit errors as a json string
app.use(function(err, req, res, next) {
if (typeof err !== 'object') {
// If the object is not an Error, create a representation that appears to be
err = {
message: String(err) // Coerce to string
};
} else {
// Ensure that err.message is enumerable (It is not by default)
Object.defineProperty(err, 'message', { enumerable: true });
}
// Return a JSON representation of #/definitions/ErrorResponse
res.set('Content-Type', 'application/json');
res.end(JSON.stringify(err));
});
var ip = process.env.IP || 'localhost';
var port = process.env.PORT || 10010;
// begin listening for client requests
app.listen(port, ip);
var urlBasePath = magic.swaggerObject.schemes[0] + '://localhost:' + port;
console.log('API ui:' + urlBasePath + config.ui.swaggerUi);
console.log('API spec:' + urlBasePath + config.ui.apiDocs);
});
This is the debugger console, I can clearly see that the configs are there but too deep, and they return undefined when i tried accessing them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.