Skip to content

Commit 074b839

Browse files
authored
Update GreetingService for 0.2.0 and update docs (#240)
Update GreetingService for 0.2.0 and update docs ### Motivation The example project needs updating, but it was only possible to do after we've tagged 0.2.0, so here we go. ### Modifications Updated the example service and updated docs for using the command plugin, which I noticed wasn't documented. ### Result The example project now uses the latest version. Our tutorials point to it, so it's good for it to track the latest and greatest. ### Test Plan Built locally. Reviewed by: gjcairo, glbrntt Builds: ✔︎ pull request validation (5.8) - Build finished. ✔︎ pull request validation (5.9) - Build finished. ✔︎ pull request validation (docc test) - Build finished. ✔︎ pull request validation (integration test) - Build finished. ✔︎ pull request validation (nightly) - Build finished. ✔︎ pull request validation (soundness) - Build finished. #240
1 parent af2ab82 commit 074b839

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

Examples/GreetingService/Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ let package = Package(
2020
.macOS(.v13)
2121
],
2222
dependencies: [
23-
.package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.1.0")),
24-
.package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.1.0")),
25-
.package(url: "https://github.com/apple/swift-openapi-urlsession", .upToNextMinor(from: "0.1.0")),
26-
.package(url: "https://github.com/swift-server/swift-openapi-vapor", .upToNextMinor(from: "0.1.0")),
23+
.package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.2.0")),
24+
.package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.2.0")),
25+
.package(url: "https://github.com/apple/swift-openapi-urlsession", .upToNextMinor(from: "0.2.0")),
26+
.package(url: "https://github.com/swift-server/swift-openapi-vapor", .upToNextMinor(from: "0.2.0")),
2727
.package(url: "https://github.com/vapor/vapor", from: "4.76.0"),
2828
],
2929
targets: [

Sources/swift-openapi-generator/Documentation.docc/Articles/Manually-invoking-the-generator-CLI.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Manually invoking the generator CLI
22

3-
Manually invoke the command-line tool to generate code as an alternative to the Swift package plugin.
3+
Manually invoke the command-line tool to generate code as an alternative to the Swift package build plugin.
44

55
## Overview
66

@@ -39,3 +39,17 @@ To see the usage documentation for the generator CLI, use the following command:
3939
```zsh
4040
% swift run swift-openapi-generator --help
4141
```
42+
43+
### Use the Swift package command
44+
45+
As an alternative to invoking the CLI manually, you can also use the package command, which works similarly to the build plugin.
46+
47+
Set up the `openapi.yaml` and `openapi-generator-config.yaml` files the same way as you would for the build plugin, and then run:
48+
49+
```
50+
swift package plugin generate-code-from-openapi --target GreetingServiceClient
51+
```
52+
53+
This will generate files into the `GreetingServiceClient` target's Sources directory, in a directory called GeneratedSources, which you can then check into your repository.
54+
55+
You can also invoke the command from the Xcode UI by control-clicking on a target in the Project Navigator, and selecting the command.

0 commit comments

Comments
 (0)