Skip to content

Introduce FullFoundationSupport trait#177

Open
madsodgaard wants to merge 1 commit intoapple:mainfrom
madsodgaard:foundation-trait
Open

Introduce FullFoundationSupport trait#177
madsodgaard wants to merge 1 commit intoapple:mainfrom
madsodgaard:foundation-trait

Conversation

@madsodgaard
Copy link
Contributor

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 open 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant