I created an adaptive form and I'm trying to fully utilize AEM Forms Data Integration. I added a rule to a button that invokes a service, that is defined by a Form Data Model, that will populate some text fields based on the output. The service is a RESTful service that is defined by a swagger file.
My question is how can I dynamically change the swagger file to use a different endpoint based on the AEM instance? For example, I want to use our dev RESTful endpoint for our dev AEM instance and then use our stage RESTful endpoint for our stage AEM instance. My thinking is that I would have to update the swagger file every time I upload my code to the different AEM environments, but this seems dangerous if I forget to change it. We could end up using the stage RESTful endpoint in our production AEM instance.
Also, I don't want to add multiple data sources for the different endpoints, because then I would have to change the rules for all the components that invoke that service every time I upload my code to the different AEM environments.
Any ideas would be gratefully appropriated!