Skip to content

Implement extensible architecture for Azure API Discovery#116

Open
JaninduRSD wants to merge 13 commits intowso2-extensions:azure-api-discoveryfrom
JaninduRSD:azurenew
Open

Implement extensible architecture for Azure API Discovery#116
JaninduRSD wants to merge 13 commits intowso2-extensions:azure-api-discoveryfrom
JaninduRSD:azurenew

Conversation

@JaninduRSD
Copy link

Purpose

Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc.

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

@@ -0,0 +1,110 @@
/*
* Copyright (c) 2025 WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we adding this file now this should be 2026 instead of 2025. fix this in other newly added files as well

Comment on lines 65 to 68
api.setType("WS");

// Set WebSocket transports
api.setTransports("ws,wss");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using magic strings, introduce constants. EX

// Better: Using Constants or Enums for type safety
api.setType(ApiType.WEBSOCKET); 

// Better: Using a dedicated constant for transport protocols
api.setTransports(Protocol.WS_ALL);

api.setTransports("ws,wss");

// Generate synthetic AsyncAPI definition for WebSocket
String protocol = data.protocols().contains(Protocol.WSS) ? "wss" : "ws";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use constants

// Set WebSocket endpoint URL if available
if (data.serviceUrl() != null) {
api.setEndpointConfig(AzureAPIUtil.buildEndpointConfigJson(
data.serviceUrl(), data.serviceUrl(), false, "ws"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use constants

api.setEndpointConfig(AzureAPIUtil.buildEndpointConfigJson(
data.serviceUrl(), data.serviceUrl(), false, "ws"));
}
api.setAvailableTiers(new HashSet<>(java.util.Collections.singleton(new Tier("Unlimited"))));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use constants

? endpointConfigJson.getAsJsonObject("production_endpoints")
: null;
String productionEndpoint = (prodEndpoints != null
&& prodEndpoints.has("url")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use constants here and all the places where applicable

api.setAvailableTiers(new HashSet<>(java.util.Collections.singleton(new Tier("Unlimited"))));
return api;
}
// public static API restAPItoAPI(ApiContract apiContract, String apiDefinition, String organization,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we dont need this please remove

@Tharsanan1 Tharsanan1 changed the base branch from main to azure-api-discovery February 26, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants