openapi-generator
openapi-generator copied to clipboard
[BUG] ASPNETCORE Collection And ICollection - Missing using System.Collections.ObjectModel;
using 4.0.2 generating for aspnetcore below are my settings
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>4.0.2</version>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.namespace}/bin/swagger/swagger.yaml</inputSpec>
<generatorName>aspnetcore</generatorName>
<output>./</output>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
<generateApiDocumentation>false</generateApiDocumentation>
<generateModelDocumentation>false</generateModelDocumentation>
<skipValidateSpec>true</skipValidateSpec>
<apiPackage>${project.namespace}.Api</apiPackage>
<modelPackage>${project.namespace}.Model</modelPackage>
<configOptions>
<returnICollection>true</returnICollection>
<useCollection>true</useCollection>
<generateBody>false</generateBody>
<operationResultTask>true</operationResultTask>
<classModifier>abstract</classModifier>
<operationModifier>abstract</operationModifier>
<sourceFolder>./</sourceFolder>
<packageName>${project.namespace}</packageName>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
2 issues found
- useCollection property works but missing the using System.Collections.ObjectModel;
- returnICollection doesn't appear to work it still generates as Collection not ICollection
expect the using System.Collections.ObjectModel; statement to also be generated and placed at the top of class file
other nice to have please additional options if possible
- Dictionary as IDictionary
- List as IList
@manhao-chen Could you please try again with the latest 5.0.0-beta? I'm wondering if this is still valid
Not sure if it's related, but I'm using 5.2.1 and returnICollection with the csharp-netcore generator does not do anything either
It's now 5 years later and this issue is still there in the current latest version 7.5.0. Are there any plans to fix this? @wing328