[Ballerina OpenAPI] Add deprecation warning for --use-sanitized-oas#1885
Conversation
📝 WalkthroughWalkthroughAdds a runtime deprecation warning to OpenApiCmd.execute() that alerts users when the --use-sanitized-oas option is provided, recommending they use Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip Migrating from UI to YAML configuration.Use the |
|
@TharmiganK please can you review my pr. It is about a if condition to warning about there is a new flag when if they use the old one. Also let me know if I need to add or edit some things in this pr. Thank you 😊 |
|



Purpose
Fixes ballerina-platform/ballerina-library#7537.
Goals
Add a deprecation warning for the
--use-sanitized-oascommand option to guide users toward using thebal openapi aligncommand moving forward.Approach
Added a boolean check inside the
execute()method of the OpenAPI command class. If the--use-sanitized-oasflag is detected, it prints a deprecation warning to theoutStreamwithout interrupting the rest of the command execution.Release note
Added a deprecation warning to the CLI indicating that the
--use-sanitized-oasoption will be removed in a future release in favor ofbal openapi align.Documentation
N/A - This is a CLI warning addition. (Note: If the official docs explicitly list this flag, they may need to be updated to reflect the deprecation).
Automation tests
Security checks
Test environment
This pull request adds a runtime deprecation warning to the OpenAPI command-line interface. When users invoke the tool with the
--use-sanitized-oasoption, the command now outputs a warning message informing them that this option is deprecated and will be removed in a future release, while recommending thebal openapi aligncommand as the replacement approach.The implementation is minimal, adding a conditional check in the
execute()method of theOpenApiCmdclass. The warning is printed to the output stream without affecting normal command execution, ensuring backward compatibility while guiding users toward the preferred alternative.