Closed suchitra-rudra closed 1 year ago
The switch you want is --azure-arm
. Of course, this assumes that your service conforms to ARM specifics.
We don't generate client constructors for data-plane as there is no consistent pattern across data-plane services.
Thank you for the quick response. --azure-arm
also did not generate the constructor. Unfortunately, as consumers of swagger we don't have control over the specifics.
If I understand correctly, for swaggers that don't conform to ARM specifics, outside the generated code package we can't create a client instance with non-zero member values?
That's correct; by default, you have to hand-write client constructors. We do this in our Autorest test suite, here's an example.
Okay thanks for the clarification. Closing this issue.
Hi @jhendrixMSFT, @tadelesh
Cient ctors are generated with version
4.0.0-preview.44
but not with version4.0.0-preview.47
. How can I get autorest to generate ctors for client structs? I suppose this relates to the discussion in https://github.com/Azure/autorest.go/issues/867 and changes in https://github.com/Azure/autorest.go/pull/910The swagger I am using has the following security definition:
I have tried the switches
--openapi-type=arm
as well as--export-clients=true
but neither seem to generate the ctor. Is the appropriate flag to use documented somewhere? I don't think I found anything here - https://github.com/Azure/autorest/blob/main/docs/generate/flags.md.Command:
Output:
Autoreset Version: