cli icon indicating copy to clipboard operation
cli copied to clipboard

[FEATURE] Support ignore feature of optimizer

Open KhudaDad414 opened this issue 1 year ago • 2 comments

Why do we need this improvement?

Optimizer 1.0.0 Supports [ignoring the schemas](https://github.com/asyncapi/optimizer?tab=readme-ov-file#applying-the-suggested-changes. I think I make sense that we introduce a new flag to the optimize flag to in CLI.

How will this change help?

It will help users over-optimizations in scenarios when there schemas are simple.

Screenshots

No response

How could it be implemented/designed?

We can add a new flag to the optimize command. something like: asyncapi optimzie --ignore schemas

🚧 Breaking changes

No

👀 Have you checked for similar open issues?

  • [X] I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue?

No, someone else can work on it.

KhudaDad414 avatar May 17 '24 10:05 KhudaDad414

Hey @KhudaDad414, I am working on this issue, but could you please provide more information on what the disableOptimizationFor does in the optimizer?

helios2003 avatar May 17 '24 20:05 helios2003

Forward of https://github.com/asyncapi/cli/issues/1323#issuecomment-2117488533:

I would suggest format of

disableOptimizationFor: {
  schema: true,
},

to be rethought in a way that makes both options (in standalone and CLI) consistent.

Like

{ disableOptimizationForSchema: true } // in the standalone Optimizer

--disableOptimizationForSchema // in CLI's command line, as the very presence of the cmd switch already
                               // means 'true' and its absence - 'false'

{ disableOptimizationForSchema: flags.disableOptimizationForSchema } // in CLI's 'optimize.ts'

@helios2003 disableOptimizationFor is simply a section in the options object responsible for aggregating a set of true/false switches. It was introduced only in v1.0.0 strictly for schema: true, has no other purposes, and can safely be removed in favor of the above change.

aeworxet avatar May 20 '24 12:05 aeworxet

:tada: This issue has been resolved in version 2.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

asyncapi-bot avatar Jul 31 '24 07:07 asyncapi-bot