Skip to content

Commit

Permalink
Update GreetingService for 0.2.0 and update docs (#240)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
czechboy0 authored Aug 31, 2023
1 parent af2ab82 commit 074b839
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Examples/GreetingService/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ let package = Package(
.macOS(.v13)
],
dependencies: [
.package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.1.0")),
.package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.1.0")),
.package(url: "https://github.com/apple/swift-openapi-urlsession", .upToNextMinor(from: "0.1.0")),
.package(url: "https://github.com/swift-server/swift-openapi-vapor", .upToNextMinor(from: "0.1.0")),
.package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.2.0")),
.package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.2.0")),
.package(url: "https://github.com/apple/swift-openapi-urlsession", .upToNextMinor(from: "0.2.0")),
.package(url: "https://github.com/swift-server/swift-openapi-vapor", .upToNextMinor(from: "0.2.0")),
.package(url: "https://github.com/vapor/vapor", from: "4.76.0"),
],
targets: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Manually invoking the generator CLI

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

## Overview

Expand Down Expand Up @@ -39,3 +39,17 @@ To see the usage documentation for the generator CLI, use the following command:
```zsh
% swift run swift-openapi-generator --help
```

### Use the Swift package command

As an alternative to invoking the CLI manually, you can also use the package command, which works similarly to the build plugin.

Set up the `openapi.yaml` and `openapi-generator-config.yaml` files the same way as you would for the build plugin, and then run:

```
swift package plugin generate-code-from-openapi --target GreetingServiceClient
```

This will generate files into the `GreetingServiceClient` target's Sources directory, in a directory called GeneratedSources, which you can then check into your repository.

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 comments on commit 074b839

Please sign in to comment.