Skip to content

Commit

Permalink
Merge pull request #594 from KavinduZoysa/change-api
Browse files Browse the repository at this point in the history
Change json conversion API names
  • Loading branch information
hasithaa authored Feb 13, 2025
2 parents 7b6ec84 + 058a1e0 commit 95a024b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ public JsonElement convert(String jsonString, boolean isRecordTypeDesc, boolean
Map<String, NonTerminalNode> recordToTypeDescNodes = new LinkedHashMap<>();
Map<String, JsonElement> jsonFieldToElements = new LinkedHashMap<>();

if (existingFieldNames.contains(this.recordName)) {
throw new JsonToRecordConverterException("Given record name already exists in the module");
}
JsonElement parsedJson = JsonParser.parseString(jsonString);
if (parsedJson.isJsonObject()) {
generateRecords(parsedJson.getAsJsonObject(), null, isClosed, recordToTypeDescNodes, null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* @since 2.0.0
*/
@JavaSPIService("org.ballerinalang.langserver.commons.service.spi.ExtendedLanguageServerService")
@JsonSegment("jsonToRecord")
@JsonSegment("jsonToRecordTypes")
public class JsonToRecordConverterService implements ExtendedLanguageServerService {
private WorkspaceManager workspaceManager;

Expand Down Expand Up @@ -90,6 +90,6 @@ public CompletableFuture<JsonToRecordResponse> convert(JsonToRecordRequest reque

@Override
public String getName() {
return "jsonToRecord";
return "jsonToRecordTypes";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* @since 2.0.0
*/
@JavaSPIService("org.ballerinalang.langserver.commons.service.spi.ExtendedLanguageServerService")
@JsonSegment("xmlToRecord")
@JsonSegment("xmlToRecordTypes")
public class XMLToRecordConverterService implements ExtendedLanguageServerService {
private WorkspaceManager workspaceManager;

Expand Down Expand Up @@ -92,6 +92,6 @@ public CompletableFuture<XMLToRecordResponse> convert(XMLToRecordRequest request

@Override
public String getName() {
return "jsonToRecord";
return "jsonToRecordTypes";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected String getApiName() {

@Override
protected String getServiceName() {
return "jsonToRecord";
return "jsonToRecordTypes";
}

private record TestConfig(String filePath, String testFilePath, String jsonString, String recordName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected String getApiName() {

@Override
protected String getServiceName() {
return "xmlToRecord";
return "xmlToRecordTypes";
}

private record TestConfig(String filePath, String xmlString, String prefix, boolean isClosed,
Expand Down

0 comments on commit 95a024b

Please sign in to comment.