-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Motivation Our tutorials were originally written for SOAR 0.1.0, so we need to update them to reflect the best practices as of SOAR 1.0 instead. ### Modifications - Adapted to the new Examples structure (most importantly, point to cloning the Vapor hello world project when writing the client, instead of the GreetingService.) - Added a mention of the shorthand APIs as an alternative to the exhaustive handling. (Still show exhaustive handling first though, as we want to make sure adopters consider that first and even prefer it.) - More minor polish and updates. ### Result Tutorials ready for 1.0 (sans versions, those are changed in #472) ### Test Plan Previewed locally, actually went through all the tutorials and verified they all work.
- Loading branch information
Showing
31 changed files
with
134 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...es/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.console.1.0.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
% git clone https://github.com/apple/swift-openapi-generator | ||
% cd swift-openapi-generator/Examples/GreetingService | ||
% cd swift-openapi-generator/Examples/hello-world-vapor-server-example |
6 changes: 3 additions & 3 deletions
6
...es/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.console.1.1.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
% git clone https://github.com/apple/swift-openapi-generator | ||
% cd swift-openapi-generator/Examples/GreetingService | ||
% cd swift-openapi-generator/Examples/hello-world-vapor-server-example | ||
|
||
% swift run GreetingService | ||
% swift run HelloWorldVaporServer | ||
.. | ||
Build complete! (37.91s) | ||
2023-06-01T10:36:58+0200 notice codes.vapor.application : [Vapor] Server starting on http://127.0.0.1:8080 | ||
2023-12-12T09:06:32+0100 notice codes.vapor.application : [Vapor] Server starting on http://127.0.0.1:8080 |
6 changes: 3 additions & 3 deletions
6
...es/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.console.1.2.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.main.0.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
// The Swift Programming Language | ||
// https://docs.swift.org/swift-book | ||
|
||
print("Hello, world!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
Sources/swift-openapi-generator/Documentation.docc/Tutorials/_Resources/client.main.7.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import OpenAPIRuntime | ||
import OpenAPIURLSession | ||
|
||
let client = Client( | ||
serverURL: try Servers.server2(), | ||
transport: URLSessionTransport() | ||
) | ||
|
||
let response = try await client.getGreeting(query: .init(name: "CLI")) | ||
print(try response.ok.body.json.message) |
Oops, something went wrong.