[BUG] Errors when running `nuget pack`
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
What's the version of OpenAPI Generator used? -
Have you search for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Bounty to sponsor the fix (example)
Description
Got the following errors when running nuget pack -Build -OutputDirectory out src/Open.Petstore/Open.Petstore.csproj
(package name set to Open.Petstore)
Model/Order.cs(37,10): error CS0246: The type or namespace name 'JsonConverterAttribute' could not be found (are you missing a using directive or an assembly reference?) [/private/tmp/Code/csharp/openapi_client/src/Open.Petstore/Open.Petstore.csproj]
Model/Order.cs(37,10): error CS0246: The type or namespace name 'JsonConverter' could not be found (are you missing a using directive or an assembly reference?) [/private/tmp/Code/csharp/openapi_client/src/Open.Petstore/Open.Petstore.csproj]
Model/Order.cs(37,31): error CS0246: The type or namespace name 'StringEnumConverter' could not be found (are you missing a using directive or an assembly reference?) [/private/tmp/Code/csharp/openapi_client/src/Open.Petstore/Open.Petstore.csproj]
Model/Pet.cs(69,10): error CS0246: The type or namespace name 'JsonConstructorAttributeAttribute' could not be found (are you missing a using directive or an assembly reference?) [/private/tmp/Code/csharp/openapi_client/src/Open.Petstore/Open.Petstore.csproj]
Model/Pet.cs(69,10): error CS0246: The type or namespace name 'JsonConstructorAttribute' could not be found (are you missing a using directive or an assembly reference?) [/private/tmp/Code/csharp/openapi_client/src/Open.Petstore/Open.Petstore.csproj]
Client/OpenAPIDateConverter.cs(19,41): error CS0246: The type or namespace name 'IsoDateTimeConverter' could not be found (are you missing a using directive or an assembly reference?) [/private/tmp/Code/csharp/openapi_client/src/Open.Petstore/Open.Petstore.csproj]
Client/ExceptionFactory.cs(23,67): error CS0246: The type or namespace name 'IRestResponse' could not be found (are you missing a using directive or an assembly reference?) [/private/tmp/Code/csharp/openapi_client/src/Open.Petstore/Open.Petstore.csproj]
Model/Pet.cs(37,10): error CS0246: The type or namespace name 'JsonConverterAttribute' could not be found (are you missing a using directive or an assembly reference?) [/private/tmp/Code/csharp/openapi_client/src/Open.Petstore/Open.Petstore.csproj]
Model/Pet.cs(37,10): error CS0246: The type or namespace name 'JsonConverter' could not be found (are you missing a using directive or an assembly reference?) [/private/tmp/Code/csharp/openapi_client/src/Open.Petstore/Open.Petstore.csproj]
Model/Pet.cs(37,31): error CS0246: The type or namespace name 'StringEnumConverter' could not be found (are you missing a using directive or an assembly reference?) [/private/tmp/Code/csharp/openapi_client/src/Open.Petstore/Open.Petstore.csproj]
3 Warning(s)
44 Error(s)
Time Elapsed 00:00:05.19
Error NU5013: Failed to build 'Open.Petstore.csproj'.
openapi-generator version
Latest master
OpenAPI declaration file content or url
Pestore spec (OAS 2.0)
Command line used for generation
nuget pack -Build -OutputDirectory out src/Open.Petstore/Open.Petstore.csproj
A workaround is to use nuget pack src/Open.Petstore/Open.Petstore.nuspec
instead.