Azure / autorest.powershell

AutoRest PowerShell Generator
MIT License
113 stars 86 forks source link

Module fails to build due to missing arguments #1353

Closed dsolodow closed 4 months ago

dsolodow commented 4 months ago

Using the Swagger for Dayforce HCM, Ubuntu 22.04, pwsh 7.4, dotnet-sdk 8 On the first pass of autorest, it gives a couple of errors: image

If I add the following to the yaml block in the readme.md:

directive:
- no-inline:
  - AmfRuleParameterModel

it will generate the files, but the build fails with a slew of "error CS0839: Argument missing": image

dolauli commented 4 months ago

@dsolodow Would you provide swagger and more details about how you generate the modules?

dsolodow commented 4 months ago

Here's the contents of the readme.md that I use for the parameters for autorest:

input-file: Dayforce.json
powershell: true
output-folder: dayforce/
clear-output-folder: true
sanitize-names: true
namespace: Dayforce
modulename: dayforce
directive:
- no-inline:
  - AmfRuleParameterModel
suppressions:
  - code: UsingTemporaryFlag

Swagger file is attached. Dayforce.json

Autorest is being run under WSL with Ubuntu 22.04, powershell 7.4.3, dotnet-sdk 8.0.303 and I've tried both node 14 and 18.20.4 with the same result. The attempt to compile the module, I've tried it under both WSL and Windows 11 with the same results.

dolauli commented 4 months ago

autorest can not support response as below.

image
dsolodow commented 4 months ago

Thanks; what if anything can be done to work around or resolve?

dolauli commented 4 months ago

Is that a real case that API does not response a json but xml?

isra-fel commented 4 months ago

We don't have a plan to support xml response (or anything other than json). @dolauli let's put this in the README.md

dsolodow commented 4 months ago

We don't have a plan to support xml response (or anything other than json). @dolauli let's put this in the README.md

So the ones that look to support multiple return types will be an issue as well?

"responses": {
          "204": {
            "description": "The KPI Data has been updated",
            "content": {
              "application/json": { },
              "text/json": { },
              "text/html": { }
            }
          },
dolauli commented 4 months ago

If there is "application/json" response, it should be supported. Otherwise, Please file a bug in the autorest repo.