Skip to content
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

Fix serviceId selection logic to update the generated OAS context #1643

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package io.ballerina.openapi.service.mapper.hateoas;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -36,7 +36,9 @@ public void addResource(String resourceName, Resource resource) {
hateoasResourceMapping.get(resourceName).add(resource);
return;
}
hateoasResourceMapping.put(resourceName, Arrays.asList(resource));
List<Resource> hateoasResources = new ArrayList<>();
hateoasResources.add(resource);
hateoasResourceMapping.put(resourceName, hateoasResources);
ayeshLK marked this conversation as resolved.
Show resolved Hide resolved
}

public Map<String, List<Resource>> getHateoasResourceMapping() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
if (!embed) {
return;
}
int serviceId = config.getSemanticModel().hashCode();
int serviceId = config.getServiceSymbol().hashCode();

Check warning on line 150 in openapi-extension/src/main/java/io/ballerina/openapi/extension/doc/gen/AbstractOpenApiDocGenerator.java

View check run for this annotation

Codecov / codecov/patch

openapi-extension/src/main/java/io/ballerina/openapi/extension/doc/gen/AbstractOpenApiDocGenerator.java#L150

Added line #L150 was not covered by tests
String targetFile = String.format(FILE_NAME_FORMAT, serviceId);
OASGenerationMetaInfo.OASGenerationMetaInfoBuilder builder = new
OASGenerationMetaInfo.OASGenerationMetaInfoBuilder();
Expand Down
Loading