Skip to content

Update OpenAPI spec generation process - #565

Merged
ChinthakaJ98 merged 1 commit into
wso2:stable/mifrom
ChinthakaJ98:api-qparam
Jul 22, 2026
Merged

Update OpenAPI spec generation process#565
ChinthakaJ98 merged 1 commit into
wso2:stable/mifrom
ChinthakaJ98:api-qparam

Conversation

@ChinthakaJ98

Copy link
Copy Markdown
Contributor

This PR will give priority to the user given context and version when generating an API via an OpenAPI definition. This will also remove the existing behaviour of modifying query params in an OpenAPI definition based on the url-mapping of a resource.

@ChinthakaJ98
ChinthakaJ98 requested a review from rosensilva as a code owner July 20, 2026 15:03
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c7d6fcfb-67bf-4c10-9c0b-c140a61641fb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/customservice/synapse/api/generator/APIGenerator.java`:
- Around line 145-148: Update the API generation branch that handles
isProvidedVersionTypeNone() so it clears the serialized version value when
versionType is none. Ensure providedVersion is not propagated into the API model
or output in this case, while preserving existing behavior for context and url
version types.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 23cd87c5-5fc4-4683-8ec4-805dc0a00d1f

📥 Commits

Reviewing files that changed from the base of the PR and between 9f9efcf and 994e73f.

📒 Files selected for processing (5)
  • org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/customservice/synapse/api/generator/APIGenerator.java
  • org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/customservice/synapse/api/generator/GenericApiObjectDefinition.java
  • org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/customservice/synapse/api/generator/RestApiAdmin.java
  • org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/customservice/synapse/api/generator/SwaggerConstants.java
  • org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/customservice/synapse/api/generator/pojo/GenerateAPIParam.java

if (!versionTypeNone) {
// Match against the swagger-declared version (not the provided one) so a stale version in the URL is stripped correctly.
String versionInPath = StringUtils.isNotBlank(swaggerVersion) ? swaggerVersion : version;
if (StringUtils.isNotEmpty(versionInPath) && apiContext.endsWith(versionInPath)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is stripping the version for versionType="context" correct? Don't we need to have a check for that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 9c75568

}
}
String version = versionTypeNone ? StringUtils.EMPTY :
(StringUtils.isNotBlank(providedVersion) ? providedVersion : (StringUtils.isNotBlank(swaggerVersion) ? swaggerVersion : StringUtils.EMPTY));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems this line is longer than 120 characters. Shall we format it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 9c75568

@ChinthakaJ98
ChinthakaJ98 merged commit ebe10b1 into wso2:stable/mi Jul 22, 2026
7 of 10 checks passed
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