Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error CS0266: Cannot implicitly convert type 'System.DateTime?' to 'System.DateTime' #1235

Open
marcelghisi opened this issue Sep 11, 2023 · 3 comments
Labels

Comments

@marcelghisi
Copy link

marcelghisi commented Sep 11, 2023

Hello in this below line related with my Certificate.cs generated file I`m receiving error below[error]
any idea to help
[file line]
global::System.DateTime? Sample.API.Models.ICertificateInternal.RevocationStatusRevokedOn { get => ((Sample.API.Models.IRevocationStatusInternal)RevocationStatus).RevokedOn; set => ((Sample.API.Models.IRevocationStatusInternal)RevocationStatus).RevokedOn = value; }

[error]
C:\Users\marcel.ghisi\Projects\venafi_autorest\generated\generated\api\Models\Certificate.cs(72,266): error CS0266: Cannot implicitly convert type 'System.DateTime?'
to 'System.DateTime'. An explicit conversion exists (are you missing a cast?) [C:\Users\marcel.ghisi\Projects\venafi_autorest\generated\SwissPkiRegistrationRestApi.
csproj]
C:\Users\marcel.ghisi\Projects\venafi_autorest\generated\generated\api\Models\CertificateOrder.cs(97,252): error CS0266: Cannot implicitly convert type 'System.DateT
ime?' to 'System.DateTime'. An explicit conversion exists (are you missing a cast?) [C:\Users\marcel.ghisi\Projects\venafi_autorest\generated\SwissPkiRegistrationRes
tApi.csproj]
C:\Users\marcel.ghisi\Projects\venafi_autorest\generated\generated\api\Models\CertificateOrder.cs(109,258): error CS0266: Cannot implicitly convert type 'System.Date
Time?' to 'System.DateTime'. An explicit conversion exists (are you missing a cast?) [C:\Users\marcel.ghisi\Projects\venafi_autorest\generated\SwissPkiRegistrationRe
stApi.csproj]
Write-Error: C:\Users\marcel.ghisi\Projects\venafi_autorest\generated\build-module.ps1:76:5``

any idea to help

@dolauli
Copy link
Contributor

dolauli commented Sep 12, 2023

Would you share more details (swaggers, README.md of configuration) how you generate the PowerShell module?

@marcelghisi
Copy link
Author

marcelghisi commented Sep 12, 2023

basically I have installed the node and npm instal -g autorest and added the json content from this swisspki swagger to test.json file and executed command below.

autorest --powershell --input-file:json.json --verbose --debug

after generation the build-module.ps1 fails.

the same json works in open-api-generator but with open api im having problems to get compatibility between ps5.1 and ps 7...basically openapi generator just works in ps7. then i have a question will it be possible to compile a version to work in ps 5.1 wit autorest?

@dolauli dolauli added the bug label Sep 14, 2023
@marcelghisi
Copy link
Author

Hello Dolauli,
do you think we will have a fix for this year? just to help my planning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants