Commit Graph

17 Commits

Author SHA1 Message Date
Honza Dvorsky 7edc42113f Default the configuration parameter (#32)
Default the configuration parameter

### Motivation

The AsyncHTTPClient transport API has undergone changes in recent months and we didn't bring back the default initializer after we adopted the shared EventLoopGroup, allowing you to create a transport with just `let transport = AsyncHTTPClientTransport()`.

### Modifications

Default the configuration parameter in the initializer to be able to do that. It's already documented to work, but it doesn't.

### Result

Match the documented behavior of being able to use `let transport = AsyncHTTPClientTransport()`.

### Test Plan

Tests still pass.


Reviewed by: dnadoba

Builds:
     ✔︎ pull request validation (5.10) - Build finished. 
     ✔︎ pull request validation (5.9) - Build finished. 
     ✔︎ pull request validation (nightly) - Build finished. 
     ✔︎ pull request validation (soundness) - Build finished. 

https://github.com/swift-server/swift-openapi-async-http-client/pull/32
2023-11-30 13:39:25 +01:00
Honza Dvorsky 1ab51feec5 Add visionOS platform support (#31)
### Motivation

While this isn't technically necessary, as all versions of a platform
not explicitly mentioned are assumed to be supported, it's better to be
explicit here.

### Modifications

Add `visionOS(.v1)` to the list of supported platforms.

### Result

Clearer support matrix.

### Test Plan

N/A, this is basically just a documentation change.
2023-11-30 00:51:18 -08:00
Honza Dvorsky 0859eada6f Handle large payloads on 32bit platforms gracefully (#29)
Handle large payloads on 32bit platforms gracefully

### Motivation

If there's a request payload with a number of bytes that can't fit into 32 bits, we'd crash.

### Modifications

Use a graceful initializer and use `.unknown` (so no `content-length` will be sent) if the size exceeds the max of a 32bit int.

### Result

No crash for large payloads on 32bit platforms.

### Test Plan

Tests pass.


Reviewed by: dnadoba

Builds:
     ✔︎ pull request validation (5.10) - Build finished. 
     ✔︎ pull request validation (5.9) - Build finished. 
     ✔︎ pull request validation (nightly) - Build finished. 
     ✔︎ pull request validation (soundness) - Build finished. 

https://github.com/swift-server/swift-openapi-async-http-client/pull/29
2023-11-28 11:26:01 +01:00
Honza Dvorsky f5bf294257 Bump to 1.0.0-alpha.1 (#28)
Bump to 1.0.0-alpha.1

### Motivation

Prepare for 1.0.0-alpha.1.

### Modifications

- Updated runtime dependency.
- Updated docs.

### Result

Ready to tag 1.0.0-alpha.1.

### Test Plan

All tests pass.


Reviewed by: simonjbeaumont

Builds:
     ✔︎ pull request validation (5.10) - Build finished. 
     ✔︎ pull request validation (5.9) - Build finished. 
     ✔︎ pull request validation (nightly) - Build finished. 
     ✔︎ pull request validation (soundness) - Build finished. 

https://github.com/swift-server/swift-openapi-async-http-client/pull/28
2023-11-28 10:40:48 +01:00
Honza Dvorsky caa53033fe Prep for 1.0 alpha, adapted to runtime changes in main (#25)
### Motivation

On main, the HTTPBody length type changed from Int to Int64.

### Modifications

Adapted the transport with this change.

### Result

Repo builds again when using the latest runtime.

### Test Plan

Adapted tests.
2023-11-27 16:13:23 +01:00
Honza Dvorsky 701d752f25 Add README badges (#24)
### Motivation

Surface the Swift version and platform support status from Swift Package
Index.

### Modifications

Added badges, plus a quick link to the docc docs, to the top of the
README.

Also, expanded the supported platforms, we do actually support iOS and
friends (was an oversight not to include it before).

### Result

Easier to quickly see our support matrix, plus the quick link to docs.

### Test Plan

Previewed locally.
2023-11-16 08:47:28 +01:00
PARAIPAN SORIN e48b152d18 Disable "respectsExistingLineBreaks" in .swift-format for more consistent styling (#23)
### Motivation

- Relates to
[#230](https://github.com/apple/swift-openapi-generator/issues/230)

### Modifications

- Disable respectsExistingLineBreaks .swift-format rule and address
changes requested

### Result

- One of the .swift-format rules will be disabled

### Test Plan

- Run Tests
2023-11-01 17:49:29 +01:00
PARAIPAN SORIN f3fa4a5008 Enable documentation comment validation in swift-format (#21) 2023-10-23 23:05:38 +02:00
Honza Dvorsky 0a0c648c90 [AHC Transport] Async bodies + swift-http-types adoption (#16)
[AHC Transport] Async bodies + swift-http-types adoption

### Motivation

AHC transport changes of the approved proposals apple/swift-openapi-generator#255 and apple/swift-openapi-generator#254.

### Modifications

- Adapts to the runtime changes, depends on HTTPTypes now.
- Both request and response streaming works.

### Result

Transport works with the 0.3.0 runtime API of.

### Test Plan

Adapted tests.


Reviewed by: dnadoba, simonjbeaumont

Builds:
     ✔︎ pull request validation (5.8) - Build finished. 
     ✔︎ pull request validation (5.9) - Build finished. 
     ✔︎ pull request validation (nightly) - Build finished. 
     ✔︎ pull request validation (soundness) - Build finished. 

https://github.com/swift-server/swift-openapi-async-http-client/pull/16
2023-09-27 17:58:10 +02:00
Honza Dvorsky f228a33bdf Adopt a custom shared client (#18)
### Motivation

We previously defaulted the HTTPClient to .init(), but that's not
correct as it was never getting shut down.

### Modifications

Instead of creating a new client, just introduce our own shared one and
use that as the default value.

Once AHC provides a shared client, we can default to that in the
configuration initializer.

### Result

No more crashing clients on dealloc.

### Test Plan

All tests pass.

---------

Co-authored-by: David Nadoba <dnadoba@gmail.com>
2023-09-18 15:38:11 +02:00
Honza Dvorsky 7e40bff52d Fix double encoding of path parameters (#15)
Fix double encoding of path parameters

### Motivation

Fixes https://github.com/apple/swift-openapi-generator/issues/251.

### Modifications

Use the already escaped path setter on `URLComponents` to avoid the second encoding pass.

### Result

Path parameters that needed escaping are only escaped once, not twice.

### Test Plan

Adapted the existing unit test to cover a path item that needs escaping.


Reviewed by: simonjbeaumont

Builds:
     ✔︎ pull request validation (5.8) - Build finished. 
     ✔︎ pull request validation (5.9) - Build finished. 
     ✔︎ pull request validation (nightly) - Build finished. 
     ✔︎ pull request validation (soundness) - Build finished. 

https://github.com/swift-server/swift-openapi-async-http-client/pull/15
2023-09-07 14:53:14 +02:00
Honza Dvorsky 902cfc7420 Docs fixes (#14)
Docs fixes

### Motivation

Docs should be correct.

### Modifications

Update docs to reflect the new version.

### Result

N/A

### Test Plan

N/A


Reviewed by: dnadoba

Builds:
     ✔︎ pull request validation (5.8) - Build finished. 
     ✔︎ pull request validation (5.9) - Build finished. 
     ✔︎ pull request validation (nightly) - Build finished. 
     ✔︎ pull request validation (soundness) - Build finished. 

https://github.com/swift-server/swift-openapi-async-http-client/pull/14
2023-08-31 14:26:14 +02:00
Honza Dvorsky 91dfd35092 Adopt the new shared HTTP client (#13)
Adopt the new shared HTTP client

### Motivation

Now that SwiftNIO/AsyncHTTPClient have a singleton variant of the `EventLoopGroup`, which allows creating an `HTTPClient` without any argument, let's simplify the initializer of the transport to take advantage of it - bringing it in line with the URLSession transport.

### Modifications

Default the HTTPClient to a new one with a default event loop group, and remove the mandatory shutdown call.

### Result

Adopters can more easily create the AHC transport.

### Test Plan

N/A


Reviewed by: dnadoba, glbrntt

Builds:
     ✔︎ pull request validation (5.8) - Build finished. 
     ✔︎ pull request validation (5.9) - Build finished. 
     ✔︎ pull request validation (nightly) - Build finished. 
     ✔︎ pull request validation (soundness) - Build finished. 

https://github.com/swift-server/swift-openapi-async-http-client/pull/13
2023-08-29 14:45:24 +02:00
Honza Dvorsky 95bb2f8456 Enable strict concurrency checking in CI (#11)
Enable strict concurrency checking in CI

### Motivation

To further avoid concurrency bugs, enable complete concurrency checking in CI.

### Modifications

Added the compiler flag to the docker-compose scripts.

### Result

If a warning of this nature comes up, because we have warnings-as-errors, it'll fail CI.

### Test Plan

Locally built without any warnings with the flag enabled.


Reviewed by: glbrntt

Builds:
     ✔︎ pull request validation (5.8) - Build finished. 
     ✔︎ pull request validation (5.9) - Build finished. 
     ✔︎ pull request validation (nightly) - Build finished. 
     ✔︎ pull request validation (soundness) - Build finished. 

https://github.com/swift-server/swift-openapi-async-http-client/pull/11
2023-08-11 16:02:13 +02:00
Mahdi Bahrami 98213b70f9 Full compatibility with the "ExistentialAny" upcoming feature (#8)
Discussed and requested in
https://github.com/apple/swift-openapi-generator/pull/99#issuecomment-1630636372
2023-07-13 08:35:08 +01:00
Denil Chungath 32f3ae2f51 Relax deployment target to macOS 10.15 (#6)
### Motivation

Relax deployment target to macOS 10.15

### Modifications

- Reduced requirement from macOS 13 to macOS 10.15
- Added the minimum version to readme and documentation

### Result

- Users will be able to deploy it on projects with a minimum deployment
target of 10.15
2023-06-13 17:23:43 +02:00
Si Beaumont db38b1b57e Initial commit
Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Si Beaumont <beaumont@apple.com>
Co-authored-by: David Nadoba <d_nadoba@apple.com>
2023-05-10 12:17:57 +01:00