update samples

This commit is contained in:
William Cheng 2021-09-23 14:29:33 +08:00
parent 538f12c36d
commit 1d934643fd
4 changed files with 16 additions and 4 deletions

View File

@ -28,13 +28,18 @@ import querystring from "querystring";
* @class * @class
*/ */
class ApiClient { class ApiClient {
constructor() { /**
* The base URL against which to resolve every API call's (relative) path.
* Overrides the default value set in spec file if present
* @param {String} basePath
*/
constructor(basePath = 'http://petstore.swagger.io:80/v2') {
/** /**
* The base URL against which to resolve every API call's (relative) path. * The base URL against which to resolve every API call's (relative) path.
* @type {String} * @type {String}
* @default http://petstore.swagger.io:80/v2 * @default http://petstore.swagger.io:80/v2
*/ */
this.basePath = 'http://petstore.swagger.io:80/v2'.replace(/\/+$/, ''); this.basePath = basePath.replace(/\/+$/, '');
/** /**
* The authentication methods to be included for all API calls. * The authentication methods to be included for all API calls.

View File

@ -28,13 +28,18 @@ import querystring from "querystring";
* @class * @class
*/ */
class ApiClient { class ApiClient {
constructor() { /**
* The base URL against which to resolve every API call's (relative) path.
* Overrides the default value set in spec file if present
* @param {String} basePath
*/
constructor(basePath = 'http://petstore.swagger.io:80/v2') {
/** /**
* The base URL against which to resolve every API call's (relative) path. * The base URL against which to resolve every API call's (relative) path.
* @type {String} * @type {String}
* @default http://petstore.swagger.io:80/v2 * @default http://petstore.swagger.io:80/v2
*/ */
this.basePath = 'http://petstore.swagger.io:80/v2'.replace(/\/+$/, ''); this.basePath = basePath.replace(/\/+$/, '');
/** /**
* The authentication methods to be included for all API calls. * The authentication methods to be included for all API calls.

View File

@ -184,6 +184,7 @@ removeFieldLabelPrefix forParsing prefix =
, (".", "'Period") , (".", "'Period")
, ("/", "'Slash") , ("/", "'Slash")
, (":", "'Colon") , (":", "'Colon")
, (";", "'Semicolon")
, ("{", "'Left_Curly_Bracket") , ("{", "'Left_Curly_Bracket")
, ("|", "'Pipe") , ("|", "'Pipe")
, ("<", "'LessThan") , ("<", "'LessThan")

View File

@ -154,6 +154,7 @@ removeFieldLabelPrefix forParsing prefix =
, (".", "'Period") , (".", "'Period")
, ("/", "'Slash") , ("/", "'Slash")
, (":", "'Colon") , (":", "'Colon")
, (";", "'Semicolon")
, ("{", "'Left_Curly_Bracket") , ("{", "'Left_Curly_Bracket")
, ("|", "'Pipe") , ("|", "'Pipe")
, ("<", "'LessThan") , ("<", "'LessThan")