apple / apple/swift-openapi-generator

Add annotations to ignore unused import warnings in generated files

Open
#946 3 comments 1 reaction 1 assignee Claimed by @tirdesh View on GitHub
area/generator good first issue kind/enhancement
Dominant language
Swift
Stars
2k
Forks
182
Avg merge
13h 28m
Merged PRs (30d)
5

Description

### Description

Example below. The update from 1.13.0 to 1.13.1 broke our CI (where all warnings as errors is set) as there is a new warning in the generated code.

```
...../destination/OpenAPIGenerator/GeneratedSources/Types+Components+RequestBodies.swift:4:25: error: package import of 'Foundation' was not used in package declarations
```

For now I can disable that option on our build but it would be great (if the warnings cannot be removed) if they could be specifically ignored with `.enableExperimentalFeature("SourceWarningControl")`?

### Reproduction

Generated code made with 1.13.0 vs 1.13.1 changes layout and now some imports are unused in some files.

### Package version(s)

```
swift-openapi-generator.git@1.13.1>(traits: default)
```

### Expected behavior

I expect generated code to be warning-free, or have known warnings specifically suppressed.

### Environment

macOS + swift from Xcode

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.