diff --git a/README.md b/README.md index 40bdaf3..44a75fc 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ this zero-dependency package will provide a swagger-client for wechat-pay's web- [![travis-ci.org build-status](https://api.travis-ci.org/kaizhu256/node-swgg-wechat-pay.svg)](https://travis-ci.org/kaizhu256/node-swgg-wechat-pay) [![coverage](https://kaizhu256.github.io/node-swgg-wechat-pay/build/coverage.badge.svg)](https://kaizhu256.github.io/node-swgg-wechat-pay/build/coverage.html/index.html) +[![NPM](https://nodei.co/npm/swgg-wechat-pay.png?downloads=true)](https://www.npmjs.com/package/swgg-wechat-pay) + [![build commit status](https://kaizhu256.github.io/node-swgg-wechat-pay/build/build.badge.svg)](https://travis-ci.org/kaizhu256/node-swgg-wechat-pay) | git-branch : | [master](https://github.com/kaizhu256/node-swgg-wechat-pay/tree/master) | [beta](https://github.com/kaizhu256/node-swgg-wechat-pay/tree/beta) | [alpha](https://github.com/kaizhu256/node-swgg-wechat-pay/tree/alpha)| @@ -105,7 +107,7 @@ this script will run a web-demo of swgg-wechat-pay instruction 1. save this script as example.js 2. run the shell command: - $ npm install kaizhu256/node-swgg-wechat-pay#alpha && PORT=8081 node example.js + $ npm install swgg-wechat-pay && PORT=8081 node example.js 3. open a browser to http://127.0.0.1:8081 and play with the web-demo 4. edit this script to suit your needs */ @@ -391,7 +393,7 @@ shBuildCiAfter () {(set -e )} shBuildCiBefore () {(set -e - # shNpmTestPublished + shNpmTestPublished shReadmeTest example.js )} diff --git a/assets.swgg.swagger.json b/assets.swgg.swagger.json index 06072ff..2a667e8 100644 --- a/assets.swgg.swagger.json +++ b/assets.swgg.swagger.json @@ -101,7 +101,7 @@ "notify_url.required": { "default": "http://wxpay.weixin.qq.com/pub_v2/pay/notify.v2.php", "description": "Notification URL. Specifies callback address for receiving WeChat payment notifications.", - "in": "path", + "in": "formData", "name": "notify_url", "required": true, "type": "string" @@ -1281,7 +1281,10 @@ "operationId": "_2F_7Bnotify_url_7D_20POST", "parameters": [ { - "$ref": "#/parameters/notify_url.required" + "in": "path", + "required": true, + "type": "string", + "x-swgg-$ref": "#/parameters/notify_url.required" }, { "$ref": "#/parameters/return_code.required" diff --git a/assets.utility2.rollup.js b/assets.utility2.rollup.js index db23332..c0ccd70 100644 --- a/assets.utility2.rollup.js +++ b/assets.utility2.rollup.js @@ -16845,9 +16845,11 @@ instruction\n\ \n\ \n\ \n\ + # shDeployCustom\n\ shDeployGithub\n\ - shReadmeTest example.sh\n\ - shReadmeTest example.js\n\ + # shDeployHeroku\n\ + # shNpmTestPublished\n\ +)}\n\ '; @@ -23652,13 +23654,13 @@ local.swaggerErrorTypeDict = { // paths.js:79: "Equivalent paths are not allowed." semanticPaths2: 'Equivalent paths {{pathList jsonStringify}} are not allowed', // paths.js:94: "Path parameters must have unique 'name' + 'in' properties" - semanticPaths3: "Path parameters must have unique 'name' + 'in' properties", + semanticPaths3: "Path parameter ${parameterDefinition.name jsonStringify} must be unique", // paths.js:107: `Path parameter ${parameterDefinition.name} was defined but never used` semanticPaths4: 'Path parameter ${parameterDefinition.name} was defined but never used', // paths.js:119: "Empty path parameter declarations are not valid" semanticPaths5: "Empty path parameter declarations are not valid - {{prefix2 jsonStringify}}", // paths.js:131: `Declared path parameter "${parameter}" needs to be defined as a path parameter at either the path or operation level` - semanticPaths6: 'Declared path parameter {{name jsonStringify}} needs to be defined as a path parameter {{prefix2}} at either the path or operation level', + semanticPaths6: 'Declared path parameter {{name jsonStringify}} needs to be defined as a path parameter {{prefix2 jsonStringify}} at either the path or operation level', // paths.js:141: `Path parameter ${parameterDefinition.name} was defined but never used` semanticPaths7: 'Path parameter {{prefix0}} was defined but never used', // refs.js:37: "Definition was declared but never used in document" @@ -25484,18 +25486,17 @@ window.swgg.uiEventListenerDict[".onEventUiReload"]({ swggInit: true });\n\ // init _methodPath self._methodPath = self._method + ' ' + self._path.replace((/\{.*?\}/g), '{}'); self.parameters.forEach(function (schemaP) { - // dereference schemaP.$ref - String(schemaP['x-swgg-$ref'] || schemaP.$ref).replace( - (/#\/parameters\/(.+?$)/), - function (match0, match1) { - match0 = match1; - local.objectSetDefault( - schemaP, - local.jsonCopy(swaggerJson.parameters[match0]) - ); - schemaP.$ref = undefined; - } - ); + // dereference schemaP + String(schemaP['x-swgg-$ref'] || schemaP.$ref).replace(( + /#\/parameters\/(.+?$)/ + ), function (match0, match1) { + match0 = match1; + local.objectSetDefault( + schemaP, + local.jsonCopy(swaggerJson.parameters[match0]) + ); + schemaP.$ref = undefined; + }); // init _idName.format and _idName.type if (self._schemaName && schemaP.name === self._idName) { schemaP.format = swaggerJson.definitions[self._schemaName] @@ -27033,6 +27034,17 @@ window.swgg.uiEventListenerDict[".onEventUiReload"]({ swggInit: true });\n\ prefix: prefix }); pathDict[tmp] = path; + // validate semanticPaths3 + tmp = {}; + path.replace((/\{.*?\}/g), function (match0) { + test = !tmp[match0]; + local.throwSwaggerError(!test && { + errorType: 'semanticPaths3', + name: match0, + prefix: prefix + }); + tmp[match0] = true; + }); // validate semanticPaths5 test = path.indexOf('{}') < 0; local.throwSwaggerError(!test && { @@ -27093,6 +27105,17 @@ window.swgg.uiEventListenerDict[".onEventUiReload"]({ swggInit: true });\n\ tmp.path[match0][0] = true; }); (operation.parameters || []).forEach(function (schemaP, ii) { + // dereference schemaP + String(schemaP['x-swgg-$ref'] || schemaP.$ref).replace(( + /#\/parameters\/(.+?$)/ + ), function (match0, match1) { + match0 = match1; + schemaP = local.objectSetDefault( + local.jsonCopy(schemaP), + local.jsonCopy(swaggerJson.parameters[match0]) + ); + schemaP.$ref = undefined; + }); // validate semanticOperations2 test = !(tmp.in.body && schemaP.in === 'body'); local.throwSwaggerError(!test && {