Skip to content

Commit

Permalink
Merge pull request #2105 from ballerina-platform/fix-openapi-overwrite
Browse files Browse the repository at this point in the history
Fix OAS embedding issues
  • Loading branch information
TharmiganK authored Aug 12, 2024
2 parents 5c9299e + 3b6bf30 commit 5a6fc69
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion ballerina/http_annotation.bal
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public type HttpServiceConfig record {|
ListenerAuthConfig[] auth?;
string mediaTypeSubtypePrefix?;
boolean treatNilableAsOptional = true;
@deprecated
byte[] openApiDefinition = [];
boolean validation = true;
typedesc<ServiceContract> serviceType?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import static io.ballerina.stdlib.http.compiler.Constants.COLON;
import static io.ballerina.stdlib.http.compiler.Constants.HTTP;
import static io.ballerina.stdlib.http.compiler.Constants.SERVICE_CONFIG_ANNOTATION;
import static io.ballerina.stdlib.http.compiler.Constants.SERVICE_TYPE;
import static io.ballerina.stdlib.http.compiler.HttpServiceValidator.getServiceContractTypeDesc;

/**
Expand Down Expand Up @@ -177,7 +178,7 @@ private ServiceDeclarationNode updateServiceConfigAnnotation(TypeDescriptorNode
boolean hasServiceType = fields.stream().anyMatch(field -> {
if (field.kind().equals(SyntaxKind.SPECIFIC_FIELD)) {
SpecificFieldNode specificField = (SpecificFieldNode) field;
return specificField.fieldName().toString().equals("serviceType");
return specificField.fieldName().toString().trim().equals(SERVICE_TYPE);
}
return false;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ public URITemplate<Resource, HttpCarbonMessage> getUriTemplate() throws URITempl
public static HttpService buildHttpService(BObject service, String basePath) {
HttpService httpService = new HttpService(service, basePath);
BMap serviceConfig = getHttpServiceConfigAnnotation(service);
httpService.populateServiceConfig(serviceConfig);
httpService.populateIntrospectionPayload();
httpService.populateServiceConfig(serviceConfig);
return httpService;
}

Expand Down

0 comments on commit 5a6fc69

Please sign in to comment.