Namespace Styra.Opa.OpenApi.Hooks
Classes
- HookRegistration
This file is only ever generated once on the first generation and then is free to be modified. Any hooks you wish to add should be registered in the InitHooks function. Feel free to define them in this file or in separate files in the Hooks folder.
Interfaces
- IAfterErrorHook
AfterErrorAsync is called after the SDK encounters an error, or a non-successful response. The hook can modify the response, if available, otherwise modify the error. All hooks are called sequentially. If an error is returned, it will be passed to the subsequent hook implementing IAfterErrorHook. If you want to prevent other AfterError hooks from being run, you can throw an FailEarlyException instead.
- IAfterSuccessHook
AfterSuccessAsync is called after the SDK receives a response. The hook can modify the response before it is handled or throw an exception to stop the response from being handled.
- IBeforeRequestHook
BeforeRequestAsync hook is called before the SDK sends a request. The hook can modify the request before it is sent or throw an exception to stop the request from being sent.
- ISDKInitHook
SDKInit hook is called when the SDK is initializing. The hook can modify and return a new baseUrl and HTTP client to be used by the SDK.