autorest icon indicating copy to clipboard operation
autorest copied to clipboard

code-model-v1 not created

Open shivamverma-ms20 opened this issue 8 months ago • 0 comments

I tried to generate ARM client files using swagger.json through autorest using

autorest readme.md --use:@microsoft.azure/[email protected]

readme.md:

### Prerequisites

1. Update the `swagger.json`. [See notes](#Swagger-notes).
2. Install AutoRest.

#Generate ARM client.
1. Navigate to \src\ServiceARMClient\client\v2025-03-30-preview
2. Run > `autorest --v3 readme.md --version=3.0.6274`

### Important notes
1. Update the swagger.son with meaningful operationId, as this will be backbone for the generated client method names.
2. In the generated client code replace,
	`            List<string> _queryParameters = new List<string>();`
	with 
	`            List<string> _queryParameters = new List<string> { "api-version=2024-03-03-preview" };`

# This is the configuration block for the Autorest.
``` yaml
# list all the input OpenAPI files (may be YAML, JSON, or Literate- OpenAPI markdown)
verbose: true
input-file: swagger.json
output-folder: Generated
clear-output-folder: true
csharp: true
namespace: Microsoft.Azure.ServiceClient.v2025_03_30_preview
azure-arm: true
license-header: "MICROSOFT_MIT_NO_VERSION"
legacy: true

The command created all the files and models but didn't generated code-model-v1, why so?

shivamverma-ms20 avatar Apr 08 '25 04:04 shivamverma-ms20