-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update retrieval of URITemplates, scopes and roles from swagger in the local entry #7401
Conversation
return (ArrayList<LinkedHashMap>) swaggerObjectAPIM.get(APIConstants.SWAGGER_X_WSO2_SCOPES); | ||
if (openAPI.getExtensions() != null) { | ||
LinkedHashMap swaggerWSO2Security = (LinkedHashMap) openAPI.getExtensions() | ||
.get(APIConstants.SWAGGER_X_WSO2_SECURITY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to do a Null check for openAPI.getExtensions().get(APIConstants.SWAGGER_X_WSO2_SECURITY) as well because there could be a NPE when casting to LinkedHashMap when there is no when get(APIConstants.SWAGGER_X_WSO2_SECURITY) becomes null. We could add the null check to the if condition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
LinkedHashMap<String, Object> scopeBindings = | ||
(LinkedHashMap<String, Object>) extensions.get(APIConstants.SWAGGER_X_SCOPES_BINDINGS); | ||
if (scopeBindings != null) { | ||
return (String) scopeBindings.get(resourceScope); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
LinkedHashMap swaggerObjectAPIM = (LinkedHashMap) swaggerWSO2Security | ||
.get(APIConstants.SWAGGER_OBJECT_NAME_APIM); | ||
if (swaggerObjectAPIM != null) { | ||
ArrayList<LinkedHashMap> apiScopes = (ArrayList<LinkedHashMap>) swaggerObjectAPIM.get(APIConstants.SWAGGER_X_WSO2_SCOPES); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -539,15 +545,15 @@ private boolean isResourcePathMatching(String resourceString, ResourceInfoDTO re | |||
} | |||
|
|||
@MethodStats | |||
private APIInfoDTO doGetAPIInfo(String context, String apiVersion) throws APISecurityException { | |||
ArrayList<URITemplate> uriTemplates = getAllURITemplates(context, apiVersion); | |||
private APIInfoDTO doGetAPIInfo(MessageContext messageContext, String context, String apiVersion) throws APISecurityException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arent we exceeding the max column length? 120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #9250
private APIInfoDTO doGetAPIProductInfo(String context, String apiVersion) throws APISecurityException { | ||
ArrayList<URITemplate> uriTemplates = getAPIProductURITemplates(context, apiVersion); | ||
private APIInfoDTO doGetAPIProductInfo(MessageContext messageContext, String context, String apiVersion) throws APISecurityException { | ||
ArrayList<URITemplate> uriTemplates = getAPIProductURITemplates(messageContext, context, apiVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, seems we are exceeding 120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #9250
* @param context API context of API | ||
* @param apiVersion Version of API | ||
* @param requestPath Incoming request path | ||
* @param httpMethod http method of request | ||
* @return verbInfoDTO which contains throttling tier for given resource and verb+resource key | ||
*/ | ||
public VerbInfoDTO getVerbInfoDTOFromAPIData(String context, String apiVersion, String requestPath, String httpMethod) | ||
public VerbInfoDTO getVerbInfoDTOFromAPIData(MessageContext messageContext, String context, String apiVersion, String requestPath, String httpMethod) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exceeding the max length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #9250
This will fix wso2/product-apim#6224