I am bit new to Spring and Java, can someone please an provide example to call an API which takes OAuth access token with ApiClient which is auto-generated using swagger plugin? By providing client id, secret and oAuth Target Url in below sample code. Please advise.
ApiClient apiClient = new ApiClient();
apiClient.setBasePath(“http://localhost:8080”);
CustomersApi customerApi = new CustomersApi(apiClient);
List customers = customerApi.getCustomers(“peter”, 40);
Below is the sample code in this blog.
https://blog.philipphauer.de/enriching-restful-services-swagger/