Azure / autorest.az

Azure CLI Code Generator
MIT License
22 stars 20 forks source link

--debug Flag added swagger details in help. --debug Flag should not change behavior of code generation. #846

Open KalpeshChavan12 opened 3 years ago

KalpeshChavan12 commented 3 years ago

Issue: --debug Flag added swagger details in help. --debug Flag should not change behavior of code generation. --debug flag should display details log on console. It should change behavior of code generation.

E.g. command help after code generated using --debug flag


helps['maintenance applyupdate show'] = """
    type: command
    short-summary: "Track maintenance updates to resource"
    short-summary: "Track maintenance updates to resource Command group swagger name=ApplyUpdates, Command swagger \
name=Get."
    examples:
      - name: ApplyUpdates_Get
        text: |-

Example code generated with --debug and without --debug flag

https://github.com/Azure/azure-cli-extensions/pull/3374/commits/2843d774aa9fc2205b000da34ab1053a7e2ea645

Recommendation: use separate flag to detail help(which include swagger details).

Code Reference to fix: https://github.com/Azure/autorest.az/blob/c85ea6a31e4dd7e45b4de0762fcc018b0062f6f6/src/generate/renders/generated/CliParams.ts#L416

kairu-ms commented 3 years ago

I think another way is writing the swagger details in code comments.