Skip to content

Commit

Permalink
Fix http tests : annotation value restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
KRVPerera committed Jun 14, 2020
1 parent 6a661b5 commit 3172e25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions stdlib/http/src/main/ballerina/src/http/annotation.bal
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public type HttpServiceConfig record {|
Chunking chunking = CHUNKING_AUTO;
CorsConfig cors = {};
Versioning versioning = {};
ServiceAuth auth?;
ServiceAuth & readonly auth?;
|};

# Configurations for CORS support.
Expand Down Expand Up @@ -114,8 +114,8 @@ public type HttpResourceConfig record {|
string[] produces = [];
CorsConfig cors = {};
boolean transactionInfectable = true;
WebSocketUpgradeConfig? webSocketUpgrade = ();
ResourceAuth auth?;
(WebSocketUpgradeConfig & readonly)? webSocketUpgrade = ();
ResourceAuth & readonly auth?;
|};

# Resource configuration to upgrade from HTTP to WebSocket.
Expand Down
4 changes: 2 additions & 2 deletions stdlib/http/src/main/ballerina/src/http/auth/utils.bal
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function getServiceAuthConfig(FilterContext context) returns ServiceAuth? {
any annData = reflect:getServiceAnnotations(context.getService(), SERVICE_ANN_NAME, ANN_MODULE);
if (!(annData is ())) {
HttpServiceConfig serviceConfig = <HttpServiceConfig> annData;
return serviceConfig?.auth;
return <ServiceAuth?>serviceConfig?.auth;
}
}

Expand All @@ -248,7 +248,7 @@ function getResourceAuthConfig(FilterContext context) returns ResourceAuth? {
ANN_MODULE);
if (!(annData is ())) {
HttpResourceConfig resourceConfig = <HttpResourceConfig> annData;
return resourceConfig?.auth;
return <ResourceAuth?>resourceConfig?.auth;
}
}

Expand Down

0 comments on commit 3172e25

Please sign in to comment.