-
Notifications
You must be signed in to change notification settings - Fork 28
Conversation
…request(). Compiles and a sanity test works ok. Signed-off-by: Gene Johnston <Eugene.Johnston@ca.com>
Signed-off-by: ChrisBoehmCA <Christopher.Boehm@ca.com>
…nd end with a slash (or not). Also ensure that no leading or trailing spaces are included. Signed-off-by: Gene Johnston <Eugene.Johnston@ca.com>
Signed-off-by: ChrisBoehmCA <Christopher.Boehm@ca.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@ca.com>
Signed-off-by: Jason <jason.tucker@ca.com>
Signed-off-by: Jason <jason.tucker@ca.com>
… - tests will fail Signed-off-by: Jason <jason.tucker@ca.com>
Signed-off-by: Jason <jason.tucker@ca.com>
Signed-off-by: Jason <jason.tucker@ca.com>
….com/zowe/imperative into 43_APIML_integration_
Signed-off-by: Jason <jason.tucker@ca.com>
…ative into 43_APIML_integration_
Signed-off-by: Jason <jason.tucker@ca.com>
Signed-off-by: Jason <jason.tucker@ca.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. This provides the ability to optionally use a base path, explains the concept well, and worked well when tested with Zowe CLI.
"\nResource: " + finalError.resource + | ||
"\nRequest: " + finalError.request + | ||
"\nHeaders: " + headerDetails + | ||
"\nPayload: " + payloadDetails; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This increased amount of information should hopefully be helpful to the user 👍
* @type {string} | ||
* @memberof ISession | ||
*/ | ||
basePath?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice thorough explanation of the concept of base path 👍
@@ -185,17 +188,11 @@ export abstract class AbstractRestClient { | |||
* Invoke any onError method whenever an error occurs on writing | |||
*/ | |||
clientRequest.on("error", (errorResponse: any) => { | |||
let impError: IImperativeError = { | |||
reject(this.populateError({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool that we now get more details in the case of client request errors
@@ -522,7 +522,7 @@ export class CommandProcessor { | |||
args._ = commandArguments._; | |||
|
|||
// Log for debugging | |||
this.log.debug(`Full argument object constructed:\n${inspect(args)}`); | |||
this.log.trace(`Full argument object constructed:\n${inspect(args)}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this to not output password populated into the arguments
Overview
Implements the ability to specify "basePath" in the rest client session object. See the Swagger doc for details on "base path".
In summary, the "base path" is used/configured by API mediation layers and API Gateways to identify a service (and versioning).
Directly to the service:
https://host:port/pets
Gateway:
https://host:port/api/v1/pet_service/pets
In the above example,
api/v1/pet_service
would be the "base path".CLI implementations which perform HTTP/REST calls can take advantage of this capability in order to be simultaneously compatible with a Gateway and going directly to a service.
Additional Improvements
Adds additional fields/properties to the rest client error for debugging/diagnostics. The additional fields are also formatted into a printable error response (found in the
additionalDetails
property of theImperativeError
) and automatically formatted/surface if a RestClientError is thrown from a handler and caught by the Imperative command processor (normal error handling for command handlers).