apple / swift-openapi-generator

Generate Swift client and server code from an OpenAPI document.
https://swiftpackageindex.com/apple/swift-openapi-generator/documentation
Apache License 2.0
1.45k stars 121 forks source link

Add the `frozen` keyword only to enums with the `public` or `package` modifiers #595

Closed ojun9 closed 4 months ago

ojun9 commented 4 months ago

Motivation

As reported in https://github.com/apple/swift-openapi-generator/issues/586, using Xcode 16 Beta 3, the generated Type.swift file now shows multiple warnings due to the @frozen attribute being applied to non-public enums.

Modifications

In order to resolve the above issue, I have modified the code to annotate the @frozen keyword only on enum with the public or package modifiers.

Result

No warnings are issued when the @frozen keyword is annotated on enums with the public or package modifiers.

czechboy0 commented 4 months ago

@swift-server-bot test this please

czechboy0 commented 4 months ago

@swift-server-bot test this please

czechboy0 commented 4 months ago

For the 5.9 and 5.9.0 pipelines, we're running into the deprecation warning being escalated to an error. We already disabled warnings-as-errors on most other pipelines, please also comment out this line in the two files for 5.9 and 5.9.0, then the CI should pass.

https://github.com/apple/swift-openapi-generator/blob/285ebba6300019d5eabcde15173809d098ac14f4/docker/docker-compose.2204.59.yaml#L14

czechboy0 commented 4 months ago

@swift-server-bot test this please