https://github.com/techouse/qs-swift-vapor
Small Vapor integration for QsSwift
https://github.com/techouse/qs-swift-vapor
linux macos qs querystring swift swiftpm url-parsing url-query vapor
Last synced: 6 days ago
JSON representation
Small Vapor integration for QsSwift
- Host: GitHub
- URL: https://github.com/techouse/qs-swift-vapor
- Owner: techouse
- License: bsd-3-clause
- Created: 2026-06-17T05:56:45.000Z (10 days ago)
- Default Branch: main
- Last Pushed: 2026-06-17T23:56:07.000Z (10 days ago)
- Last Synced: 2026-06-18T00:10:57.836Z (10 days ago)
- Topics: linux, macos, qs, querystring, swift, swiftpm, url-parsing, url-query, vapor
- Language: Swift
- Homepage: https://techouse.github.io/qs-swift-vapor/
- Size: 336 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# QsSwiftVapor
Small Vapor integration for [QsSwift](https://github.com/techouse/qs-swift).
[](https://github.com/techouse/qs-swift-vapor/releases/latest)
[](https://swiftpackageindex.com/techouse/qs-swift-vapor)
[](https://swiftpackageindex.com/techouse/qs-swift-vapor)
[](LICENSE)
[](https://github.com/techouse/qs-swift-vapor/actions/workflows/test.yml)
[](https://codecov.io/gh/techouse/qs-swift-vapor)
[](https://app.codacy.com/gh/techouse/qs-swift-vapor/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://github.com/sponsors/techouse)
[](https://github.com/techouse/qs-swift-vapor/stargazers)
`QsSwiftVapor` adds one request helper that parses the request's encoded query string with QsSwift, bypassing Vapor's
typed query container when you need qs-compatible nested query-string behavior.
## Installation
Add the package to your SwiftPM dependencies:
```swift
.package(url: "https://github.com/techouse/QsSwiftVapor.git", from: "1.0.0")
```
Then add the product to your Vapor target:
```swift
.product(name: "QsSwiftVapor", package: "QsSwiftVapor")
```
## Usage
```swift
import QsSwift
import QsSwiftVapor
import Vapor
app.get("search") { req async throws -> [String: String] in
let query = try req.parseQsQuery(
options: DecodeOptions(strictNullHandling: true)
)
return [
"parsed": String(describing: query),
]
}
```
`parseQsQuery(options:)` reads `req.url.query` and passes it directly to `Qs.decode`. It does not use `req.query`, so
Vapor's form decoder does not collapse duplicate keys, reinterpret name-only parameters as boolean flags, or apply
Vapor-specific typed decoding behavior.
## Non-goals
- No typed `Decodable` query helper.
- No middleware or global query decoder configuration.
- No Vapor `URI` query-building helper.
Use QsSwift's Foundation `URLComponents` and `URL` helpers for URL construction.