Skip to content

Commit 2809c4e

Browse files
committed
Expand the README
1 parent 5dd6347 commit 2809c4e

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,26 @@
1-
# swift-openapi-vapor
2-
Vapor Bindings for the OpenAPI Generator
1+
# Swift OpenAPI Vapor
2+
3+
This package provides Vapor Bindings for the [OpenAPI generator](https://github.com/apple/swift-openapi-generator).
4+
5+
## Usage
6+
7+
In `entrypoint.swift` add:
8+
9+
```swift
10+
// Create a Vapor OpenAPI Transport using your application.
11+
let transport = VaporOpenAPITransport(app)
12+
13+
// Create an instance of your handler type that conforms the generated protocol
14+
// defining your service API.
15+
let handler = MyServiceAPIImpl()
16+
17+
// Call the generated function on your implementation to add its request
18+
// handlers to the app.
19+
try handler.registerHandlers(on: transport, serverURL: Servers.server1())
20+
```
21+
22+
## Documentation
23+
24+
To get started, check out the full [documentation][docs-generator], which contains step-by-step tutorials!
25+
26+
[docs-generator]: https://swiftpackageindex.com/apple/swift-openapi-generator/documentation

0 commit comments

Comments
 (0)