forked from loafle/openapi-generator-original
update samples
This commit is contained in:
@@ -123,6 +123,16 @@ public class ApiClient {
|
||||
return objectMapper;
|
||||
}
|
||||
|
||||
private RequestInterceptor buildOauthRequestInterceptor(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) {
|
||||
switch (flow) {
|
||||
case password:
|
||||
return new OauthPasswordGrant(tokenUrl, scopes);
|
||||
case application:
|
||||
return new OauthClientCredentialsGrant(authorizationUrl, tokenUrl, scopes);
|
||||
default:
|
||||
throw new RuntimeException("Oauth flow \"" + flow + "\" is not implemented");
|
||||
}
|
||||
}
|
||||
|
||||
public ObjectMapper getObjectMapper(){
|
||||
return objectMapper;
|
||||
|
||||
Reference in New Issue
Block a user