Skip to content

Introduce FullFoundation trait#177

Merged
czechboy0 merged 13 commits intoapple:mainfrom
madsodgaard:foundation-trait
Mar 2, 2026
Merged

Introduce FullFoundation trait#177
czechboy0 merged 13 commits intoapple:mainfrom
madsodgaard:foundation-trait

Conversation

@madsodgaard
Copy link
Contributor

@madsodgaard madsodgaard commented Feb 27, 2026

Part of apple/swift-openapi-generator#868

This PR introduces a new default trait FullFoundationSupport. If users remove this trait it does two things:

  1. On non-darwin platforms it replaces the use of ISO8601DateFormatter with the new Foundation APIs.
  2. Disables support for NSNull and NSNumber in OpenAPIValue.

If non-darwin platforms disable this trait, its technically source breaking if they rely on the initializer of ISO8601DateTranscoder, because it relies on the ISO8601DateFormatter.Options object. I am not sure how we would get around that. But again, it requires users to explicitly remove the trait, and thereby want to opt in to only relying on FoundationEssentials. So imo its acceptable.

I am not sure about CI. We really should be testing with and without the trait, but I could not find other examples that use the swift-nio jobs to do this. But if you could point me in the right direction, I can add that as well.

From what I understand from @FranzBusch, we also only have 1 chance of adding default traits. Are there any other traits we should think about introducing?

madsodgaard and others added 2 commits March 2, 2026 14:58
Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Honza Dvorsky <honza@apple.com>
@madsodgaard madsodgaard changed the title Introduce FullFoundationSupport trait Introduce FullFoundation trait Mar 2, 2026
Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Honza Dvorsky <honza@apple.com>
Copy link
Contributor

@czechboy0 czechboy0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @madsodgaard 🙏

@czechboy0 czechboy0 added the 🔨 semver/patch No public API change. label Mar 2, 2026
@czechboy0
Copy link
Contributor

You'll need to add the Package@6.0.swift to the license header ignore list

@czechboy0 czechboy0 enabled auto-merge (squash) March 2, 2026 14:17
auto-merge was automatically disabled March 2, 2026 14:22

Head branch was pushed to by a user without write access

@czechboy0 czechboy0 enabled auto-merge (squash) March 2, 2026 14:36
@czechboy0 czechboy0 merged commit 80f395b into apple:main Mar 2, 2026
38 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants