CustomImportPath is used by Zanzibar in its "wiring logic" for clients and middlewares. With a custom import path, the source code of middlewares and clients can reside in path different from the location of the config files.
CustomImportPath is only supported for middlewares and clients with CustomInitialisation set to true. This is done to reduce testing complexity since there are multiple path variables already in place in the configuration with varying degree of support.
Middlewares:
To include middleware code that resides in a custom path, the following config needs to be in place:
CustomInitialisation is set to true
config.path is set to the import path - this is required to include the middleware in the various endpoint files
CustomImportPath is set to the import path - this is required to support middleware initialisation
Clients
To include client code that resides in a custom path, the following config needs to be in place:
CustomInitialisation is set to true
CustomImportPath is set to the import path - this is required to support client initialisation
Note for future
This approach is a stopgap to support inclusion of externally located middlewares and clients. Path handling should be much simpler. A component should have a config to specify if it is auto generated or user provided. For auto generated components, the path is Zanzibar provided and for the other one it is user provided. For the second case, user provided code must also provide initialisation logic - there is no value in Zanzibar generating that bit.
With this simplification - CustomInitialisation and CustomImportPath variables will no longer be required.
CustomImportPath is used by Zanzibar in its "wiring logic" for clients and middlewares. With a custom import path, the source code of middlewares and clients can reside in path different from the location of the config files.
CustomImportPath is only supported for middlewares and clients with CustomInitialisation set to true. This is done to reduce testing complexity since there are multiple path variables already in place in the configuration with varying degree of support.
Middlewares:
To include middleware code that resides in a custom path, the following config needs to be in place:
CustomInitialisation
is set to trueconfig.path
is set to the import path - this is required to include the middleware in the various endpoint filesCustomImportPath
is set to the import path - this is required to support middleware initialisationClients
To include client code that resides in a custom path, the following config needs to be in place:
CustomInitialisation
is set to trueCustomImportPath
is set to the import path - this is required to support client initialisationNote for future
This approach is a stopgap to support inclusion of externally located middlewares and clients. Path handling should be much simpler. A component should have a config to specify if it is auto generated or user provided. For auto generated components, the path is Zanzibar provided and for the other one it is user provided. For the second case, user provided code must also provide initialisation logic - there is no value in Zanzibar generating that bit.
With this simplification -
CustomInitialisation
andCustomImportPath
variables will no longer be required.