repo_name stringlengths 1 62 | dataset stringclasses 1
value | lang stringclasses 11
values | pr_id int64 1 20.1k | owner stringlengths 2 34 | reviewer stringlengths 2 39 | diff_hunk stringlengths 15 262k | code_review_comment stringlengths 1 99.6k |
|---|---|---|---|---|---|---|---|
swift-openapi-generator | github_2023 | others | 471 | apple | czechboy0 | @@ -14,6 +14,71 @@
import OpenAPIKit
+/// Validates all content types from an OpenAPI document represented by a ParsedOpenAPIRepresentation.
+///
+/// This function iterates through the paths, endpoints, and components of the OpenAPI document,
+/// checking and reporting any invalid content types using the provide... | Let's iterate both keys and values, to allow us to print the key later down.
```suggestion
for (key, component) in doc.components.requestBodies {
``` |
swift-openapi-generator | github_2023 | others | 471 | apple | czechboy0 | @@ -14,6 +14,71 @@
import OpenAPIKit
+/// Validates all content types from an OpenAPI document represented by a ParsedOpenAPIRepresentation.
+///
+/// This function iterates through the paths, endpoints, and components of the OpenAPI document,
+/// checking and reporting any invalid content types using the provide... | ```suggestion
for (key, component) in doc.components.responses {
```
Same here. And please include the key in the diagnostic. |
swift-openapi-generator | github_2023 | others | 471 | apple | czechboy0 | @@ -14,6 +14,71 @@
import OpenAPIKit
+/// Validates all content types from an OpenAPI document represented by a ParsedOpenAPIRepresentation.
+///
+/// This function iterates through the paths, endpoints, and components of the OpenAPI document,
+/// checking and reporting any invalid content types using the provide... | ```suggestion
message:
"Invalid content type string."
context: ["contentType": contentType.rawValue, "location": "#/components/responses/\(key.rawValue)", "recoverySuggestion": "Must have 2 components separated by a slash '<type>/<subtype>'."]
```
P... |
swift-openapi-generator | github_2023 | others | 489 | apple | czechboy0 | @@ -1,21 +1,86 @@
-REPO_URL = https://github.com/apple/swift-openapi-generator
-VERSION = 1.0.0
-TMP_DIR = /tmp
-REPO_DIR = $(TMP_DIR)/swift-openapi-generator
-CLI_EXECUTABLE = $(REPO_DIR)/.build/release/swift-openapi-generator
+# To see how to drive this makefile use:
+#
+# % make help
-$(REPO_DIR):
- git clone --... | The default was release before, should we retain that? |
swift-openapi-generator | github_2023 | others | 492 | apple | czechboy0 | @@ -48,6 +48,7 @@ extension TypesFileTranslator {
let nestedDecls = try translateSchema(typeName: elementType.typeName, schema: items, overrides: .none)
inline.append(contentsOf: nestedDecls)
}
+ if items.nullable { elementType = elementType.asOptional } | Please remove this one, doesn't seem necessary. |
swift-openapi-generator | github_2023 | others | 488 | apple | groue | @@ -613,13 +613,16 @@ final class Test_Client: XCTestCase {
}
func testProbe_undocumented() async throws {
- transport = .init { request, requestBody, baseURL, operationID in (.init(status: .serviceUnavailable), nil) }
+ transport = .init { request, requestBody, baseURL, operationID in (.init(... | 🤣❤️ |
swift-openapi-generator | github_2023 | others | 479 | apple | czechboy0 | @@ -8,60 +8,171 @@ Generate Swift client and server code from an OpenAPI document.
## Overview
-[OpenAPI][openapi] is an open specification for documenting HTTP APIs.
+[OpenAPI][openapi] is a specification for documenting HTTP services. An OpenAPI document is written in either YAML or JSON, and can be read by tool... | ```suggestion
- Client, server, and middleware abstractions, decoupling the generated code from the HTTP client library and web framework.
``` |
swift-openapi-generator | github_2023 | others | 479 | apple | czechboy0 | @@ -8,60 +8,171 @@ Generate Swift client and server code from an OpenAPI document.
## Overview
-[OpenAPI][openapi] is an open specification for documenting HTTP APIs.
+[OpenAPI][openapi] is a specification for documenting HTTP services. An OpenAPI document is written in either YAML or JSON, and can be read by tool... | ```suggestion
serverURL: URL(string: "http://localhost:8080/api")!,
transport: URLSessionTransport()
```
Just to make the spaces consistent with the server example below. |
swift-openapi-generator | github_2023 | others | 479 | apple | czechboy0 | @@ -8,49 +8,90 @@ Generate Swift client and server code from an OpenAPI document.
## Overview
-[OpenAPI][openapi] is an open specification for documenting HTTP APIs. An OpenAPI document is written in either YAML or JSON. These machine-readable formats can be read by tools to automate workflows. OpenAPI has an larg... | ```suggestion
serverURL: URL(string: "http://localhost:8080/api")!,
transport: URLSessionTransport()
```
Same as above. |
swift-openapi-generator | github_2023 | others | 479 | apple | czechboy0 | @@ -8,49 +8,90 @@ Generate Swift client and server code from an OpenAPI document.
## Overview
-[OpenAPI][openapi] is an open specification for documenting HTTP APIs. An OpenAPI document is written in either YAML or JSON. These machine-readable formats can be read by tools to automate workflows. OpenAPI has an larg... | ```suggestion
- Client, server, and middleware abstractions, decoupling the generated code from the HTTP client library and web framework.
``` |
swift-openapi-generator | github_2023 | others | 480 | apple | simonjbeaumont | @@ -0,0 +1,59 @@
+# Frequently asked questions
+
+Review some frequently asked questions below.
+
+## Overview
+
+This article includes some commonly asked questions and answers.
+
+### Which underlying HTTP library does the generated code use?
+
+Swift OpenAPI Generator is not tied to any particular HTTP library. Inst... | Avoiding the word linked, in case people get the wrong idea about compile-time linking.
```suggestion
Swift OpenAPI Generator lists some transport implementations in its [README](https://github.com/apple/swift-openapi-generator#repository-organization), but anyone is welcome to create their own custom transport imp... |
swift-openapi-generator | github_2023 | others | 480 | apple | simonjbeaumont | @@ -0,0 +1,59 @@
+# Frequently asked questions
+
+Review some frequently asked questions below.
+
+## Overview
+
+This article includes some commonly asked questions and answers.
+
+### Which underlying HTTP library does the generated code use?
+
+Swift OpenAPI Generator is not tied to any particular HTTP library. Inst... | ```suggestion
### Do I commit the generated code to my source repository?
``` |
swift-openapi-generator | github_2023 | others | 480 | apple | simonjbeaumont | @@ -0,0 +1,59 @@
+# Frequently asked questions
+
+Review some frequently asked questions below.
+
+## Overview
+
+This article includes some commonly asked questions and answers.
+
+### Which underlying HTTP library does the generated code use?
+
+Swift OpenAPI Generator is not tied to any particular HTTP library. Inst... | ```suggestion
When run in `client` mode, the generator emits a type called `Client` that conforms to a generated protocol called `APIProtocol`, which defines one method per OpenAPI operation. Client code generation provides you with a concrete implementation that makes HTTP requests over a provided transport. From you... |
swift-openapi-generator | github_2023 | others | 480 | apple | simonjbeaumont | @@ -0,0 +1,59 @@
+# Frequently asked questions
+
+Review some frequently asked questions below.
+
+## Overview
+
+This article includes some commonly asked questions and answers.
+
+### Which underlying HTTP library does the generated code use?
+
+Swift OpenAPI Generator is not tied to any particular HTTP library. Inst... | ```suggestion
When run in `server` mode, the generator emits the same `APIProtocol` protocol, and you implement a type that conforms to it, providing one method per OpenAPI operation. The other server generated code takes care of registering the generated routes on the underlying server. That means that when a new ope... |
swift-openapi-generator | github_2023 | others | 480 | apple | simonjbeaumont | @@ -0,0 +1,59 @@
+# Frequently asked questions
+
+Review some frequently asked questions below.
+
+## Overview
+
+This article includes some commonly asked questions and answers.
+
+### Which underlying HTTP library does the generated code use?
+
+Swift OpenAPI Generator is not tied to any particular HTTP library. Inst... | "any name" will work? |
swift-openapi-generator | github_2023 | others | 478 | apple | simonjbeaumont | @@ -44,11 +44,11 @@
}
}
@Section(title: "Add a Swagger UI endpoint") {
- Now we'll add a static `openapi.html` page that serves Swagger UI and add a redirect to this page from `/` for discoverability.
+ Now we'll add a static `openapi.html` page that serves Swagger UI and add a redirect... | Either this, or the `@Section` need updating. One says the endpoint is `/openapi`, the other `openapi.yaml`. |
swift-openapi-generator | github_2023 | others | 478 | apple | simonjbeaumont | @@ -3,12 +3,7 @@ import PackageDescription
let package = Package(
name: "GreetingServiceClient",
- platforms: [
- .macOS(.v10_15),
- .iOS(.v13),
- .tvOS(.v13),
- .watchOS(.v6),
- ],
+ platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)], | `visionOS`? |
swift-openapi-generator | github_2023 | others | 478 | apple | simonjbeaumont | @@ -1 +1,4 @@
+// The Swift Programming Language
+// https://docs.swift.org/swift-book
+ | Do we want this? |
swift-openapi-generator | github_2023 | others | 477 | apple | czechboy0 | @@ -0,0 +1,106 @@
+name: 🐞 Report a bug
+description: >
+ Report a deviation from expected or documented behavior, but not a crash.
+labels: [kind/bug, status/triage]
+body:
+ - type: markdown
+ attributes:
+ value: >
+ This repository hosts issues for the Swift OpenAPI generator, the Swift
+ O... | ```suggestion
generate: [types, client]
```
|
swift-openapi-generator | github_2023 | others | 477 | apple | czechboy0 | @@ -0,0 +1,106 @@
+name: 🐞 Report a bug
+description: >
+ Report a deviation from expected or documented behavior, but not a crash.
+labels: [kind/bug, status/triage]
+body:
+ - type: markdown
+ attributes:
+ value: >
+ This repository hosts issues for the Swift OpenAPI generator, the Swift
+ O... | ```suggestion
label: Package version(s)
```
|
swift-openapi-generator | github_2023 | others | 477 | apple | czechboy0 | @@ -0,0 +1,106 @@
+name: 🐞 Report a bug
+description: >
+ Report a deviation from expected or documented behavior, but not a crash.
+labels: [kind/bug, status/triage]
+body:
+ - type: markdown
+ attributes:
+ value: >
+ This repository hosts issues for the Swift OpenAPI generator, the Swift
+ O... | Maybe also `sw_vers` if on an Apple platform? |
swift-openapi-generator | github_2023 | others | 477 | apple | czechboy0 | @@ -0,0 +1,35 @@
+blank_issues_enabled: true
+contact_links:
+ - name: 📖 Learn about Swift OpenAPI Generator
+ url: https://swiftpackageindex.com/apple/swift-openapi-generator/documentation/
+ about: >
+ Read the rendered Swift OpenAPI Generator documentation on Swift Package Index.
+ - name: 🧑🏫 Exampl... | Can you actually add a new blank FAQ page so that these links can be accurate? I don't suppose the OpenAPI patterns page will actually be our FAQ? |
swift-openapi-generator | github_2023 | others | 477 | apple | czechboy0 | @@ -0,0 +1,35 @@
+blank_issues_enabled: true
+contact_links:
+ - name: 📖 Learn about Swift OpenAPI Generator
+ url: https://swiftpackageindex.com/apple/swift-openapi-generator/documentation/
+ about: >
+ Read the rendered Swift OpenAPI Generator documentation on Swift Package Index.
+ - name: 🧑🏫 Exampl... | ```suggestion
Formally propose an addition, or change to the features of the
```
Post 1.0 I don't think we're likely to accept any removals. |
swift-openapi-generator | github_2023 | others | 477 | apple | czechboy0 | @@ -0,0 +1,35 @@
+blank_issues_enabled: true
+contact_links:
+ - name: 📖 Learn about Swift OpenAPI Generator
+ url: https://swiftpackageindex.com/apple/swift-openapi-generator/documentation/
+ about: >
+ Read the rendered Swift OpenAPI Generator documentation on Swift Package Index.
+ - name: 🧑🏫 Exampl... | Can we move this much higher? I suspect otherwise people will still file it on us. Should come before the button to create an issue on us. |
swift-openapi-generator | github_2023 | others | 477 | apple | czechboy0 | @@ -0,0 +1,30 @@
+name: 🙋 Ask a question
+description: >
+ Ask a question about or get help with Swift OpenAPI Generator. Beginner
+ questions welcome!
+labels: [kind/support, status/triage]
+body:
+ - type: markdown
+ attributes:
+ value: >
+ This repository hosts issues for the Swift OpenAPI genera... | Same here, let's update with a link to the real FAQ. |
swift-openapi-generator | github_2023 | others | 477 | apple | czechboy0 | @@ -0,0 +1,30 @@
+name: 🙋 Ask a question
+description: >
+ Ask a question about or get help with Swift OpenAPI Generator. Beginner
+ questions welcome!
+labels: [kind/support, status/triage]
+body:
+ - type: markdown
+ attributes:
+ value: >
+ This repository hosts issues for the Swift OpenAPI genera... | ```suggestion
for solutions to commonly asked questions and common workflows.
```
I believe a hyphen is not needed after -ly? |
swift-openapi-generator | github_2023 | others | 466 | apple | simonjbeaumont | @@ -16,7 +16,7 @@ The tool uses the [Vapor](https://github.com/vapor/vapor) server framework to ha
The CLI starts the server on `http://localhost:8080` and can be invoked by running the `AuthenticationClientMiddleware` example client or on the command line using:
``` | Nice-to-have: if you use
```
\`\`\`console
% command line
console output
% command line
console output
console output
\`\`\`
```
```console
% command line
console output
% command line
console output
console output
``` |
swift-openapi-generator | github_2023 | others | 467 | apple | czechboy0 | @@ -8,12 +8,9 @@ that use `swift-log` to log requests and responses.
## Overview
This example extends the [hello-world-urlsession-client-example](../hello-world-urlsession-client-example)
-with a new target, `LoggingMiddleware`, which is then used when creating
-the `Client`.
-
-The `LoggingMiddleware` provides two... | ```suggestion
with a new target, `LoggingMiddleware`, which can be used when creating
``` |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,123 @@
+//===----------------------------------------------------------------------===//
+//
+// This source file is part of the SwiftOpenAPIGenerator open source project
+//
+// Copyright (c) 2023 Apple Inc. and the SwiftOpenAPIGenerator project authors
+// Licensed under Apache License v2.0
+//
+// See LIC... | I think we should move this one up before multipart, so that the flow is:
1. Simple request with one content type.
2. Simple request with one (other) content type. (we have these already).
3. Request that can return one of several content types.
4. Then move onto multipart things.
I also think we could use som... |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,161 @@
+//===----------------------------------------------------------------------===//
+//
+// This source file is part of the SwiftOpenAPIGenerator open source project
+//
+// Copyright (c) 2023 Apple Inc. and the SwiftOpenAPIGenerator project authors
+// Licensed under Apache License v2.0
+//
+// See LIC... | ⛄ ❤️ |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,161 @@
+//===----------------------------------------------------------------------===//
+//
+// This source file is part of the SwiftOpenAPIGenerator open source project
+//
+// Copyright (c) 2023 Apple Inc. and the SwiftOpenAPIGenerator project authors
+// Licensed under Apache License v2.0
+//
+// See LIC... | I think some comments here could help. |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,36 @@
+// swift-tools-version:5.9
+//===----------------------------------------------------------------------===//
+//
+// This source file is part of the SwiftOpenAPIGenerator open source project
+//
+// Copyright (c) 2023 Apple Inc. and the SwiftOpenAPIGenerator project authors
+// Licensed under Apache L... | Oh, I hate this swift-format'ing so much. |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+// This source file is part of the SwiftOpenAPIGenerator open source project
+//
+// Copyright (c) 2023 Apple Inc. and the SwiftOpenAPIGenerator project authors
+// Licensed under Apache License v2.0
+//
+// See LICE... | Will this work without `@testable`? Might be nice to remove since the goal of this, stated in the other file, is `A hand-written Swift API for the greeting service, one that doesn't leak any generated code`. Might have to move the extension to another file. |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,4 @@
+generate:
+ - types
+ - client
+accessModifier: internal | Why does this need to be `internal` for a curated library client package? Can't it be `package` still? |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// This source file is part of the SwiftOpenAPIGenerator open source project
+//
+// Copyright (c) 2023 Apple Inc. and the SwiftOpenAPIGenerator project authors
+// Licensed under Apache License v2.0
+//
+// See LICE... | Seems a bit inconsistent currently. `underlyingClient` is an existential, but here we don't allow the user to provide a transport. If we're going to hardcode `URLSessionTransport` then we should make `underlyingClient` concrete.
However, I'm probably in favour of accepting `any ClientTransport` here and defaulting t... |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,21 @@
+REPO_URL = https://github.com/apple/swift-openapi-generator
+VERSION = 1.0.0-alpha.1
+TMP_DIR = /tmp
+REPO_DIR = $(TMP_DIR)/swift-openapi-generator
+CLI_EXECUTABLE = $(REPO_DIR)/.build/release/swift-openapi-generator | ```suggestion
REPO_URL ?= https://github.com/apple/swift-openapi-generator
VERSION ?= 1.0.0-alpha.1
TMP_DIR ?= /tmp
REPO_DIR ?= $(TMP_DIR)/swift-openapi-generator
CLI_EXECUTABLE ?= $(REPO_DIR)/.build/release/swift-openapi-generator
``` |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,21 @@
+REPO_URL = https://github.com/apple/swift-openapi-generator
+VERSION = 1.0.0-alpha.1
+TMP_DIR = /tmp
+REPO_DIR = $(TMP_DIR)/swift-openapi-generator
+CLI_EXECUTABLE = $(REPO_DIR)/.build/release/swift-openapi-generator
+
+$(REPO_DIR):
+ git clone --branch $(VERSION) $(REPO_URL) $(REPO_DIR) | ```suggestion
git clone --branch $(VERSION) --depth 1 $(REPO_URL) $(REPO_DIR)
``` |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,36 @@
+# OpenAPI Endpoints Server
+
+An example project using [Swift OpenAPI Generator](https://github.com/apple/swift-openapi-generator).
+
+## Overview
+
+A server that shows setting up endpoints that serve the OpenAPI document and also a web page with the rendered documentation, respectively. It also uses... | Should we include a screenshot here (relying on Github user content to store it, not checking in), or not? |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,63 @@
+//
+// ContentView.swift
+// iOSAppClient
+// | Missing license header. |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,63 @@
+//
+// ContentView.swift
+// iOSAppClient
+//
+
+import SwiftUI
+import OpenAPIRuntime
+import OpenAPIURLSession
+
+/// A content view that can make HTTP requests to the GreetingService
+/// running on localhost to fetch customized greetings.
+///
+/// By default, it makes live network calls, but it... | Do we really need this env-var dance? I think it's probably enough to be using the mock client in the previews and the real client in the simulator? |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,8 @@
+// | Again, missing header. |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -0,0 +1,11 @@
+# Starting with an example project
+
+Duplicate a working example to start your project.
+
+## Overview
+
+All the examples are self-contained, so you can copy the package directory of your chosen example and use it as a starter template for your project.
+
+### Getting started
+
+TODO: Copy the conte... | Let's just link to the examples directory on Github. No point in copying its contents since the next link will take you to Github anyway (for each specific example). |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -69,6 +69,10 @@ read -ra PATHS_TO_CHECK_FOR_LICENSE <<< "$( \
":(exclude)**/docker-compose.yaml" \
":(exclude)Plugins/OpenAPIGenerator/PluginsShared" \
":(exclude)Plugins/OpenAPIGeneratorCommand/PluginsShared" \
+ ":(exclude)Examples/iOSAppClient/*" \ | OK, this one is too broad, and the reason the Swift files were not checked. |
swift-openapi-generator | github_2023 | others | 422 | apple | simonjbeaumont | @@ -32,7 +32,7 @@ SWIFTFORMAT_BIN=${SWIFTFORMAT_BIN:-$(command -v swift-format)} || fatal "❌ SWI
git -C "${REPO_ROOT}" ls-files -z '*.swift' \
| grep -z -v -e 'Tests/OpenAPIGeneratorReferenceTests/Resources' \
- -e 'Sources/swift-openapi-generator/Documentation.docc' \
+ -e 'Sources/swift-openapi-generato... | ```suggestion
-e 'Sources/swift-openapi-generator/Documentation.docc' \
-e 'Generated' \
``` |
swift-openapi-generator | github_2023 | others | 440 | apple | simonjbeaumont | @@ -0,0 +1,24 @@
+# Client Authentication Middleware
+
+In this example we'll implement a `ClientMiddleware` that injects an authentication header into the request.
+
+## Overview
+
+This example extends the [HelloWorldURLSessionClient](../HelloWorldURLSessionClient)
+with a new target, `AuthenticationClientMiddleware`... | This needs some more. Can we make the token an env var so we can see it fail without and succeed with? |
swift-openapi-generator | github_2023 | others | 450 | apple | simonjbeaumont | @@ -9,26 +9,27 @@ Swift OpenAPI Generator generates client and server Swift code from an OpenAPI d
This document outlines the API stability goals for the generator to help you avoid unintentional build errors when updating to a new version of Swift OpenAPI Generator.
The components covered by these rules are:
-- th... | ```suggestion
```
Can we remove these headings. It breaks the flow. This heading used to make sense as it was a pre-1.0 caveat. Now it doesn't because the whole doc is about API stability. |
swift-openapi-generator | github_2023 | others | 450 | apple | simonjbeaumont | @@ -9,26 +9,27 @@ Swift OpenAPI Generator generates client and server Swift code from an OpenAPI d
This document outlines the API stability goals for the generator to help you avoid unintentional build errors when updating to a new version of Swift OpenAPI Generator.
The components covered by these rules are: | ```suggestion
Swift OpenAPI Generator follows [Semantic Versioning 2.0.0][0] for the following, which are considered part of its API:
``` |
swift-openapi-generator | github_2023 | others | 450 | apple | simonjbeaumont | @@ -9,26 +9,27 @@ Swift OpenAPI Generator generates client and server Swift code from an OpenAPI d
This document outlines the API stability goals for the generator to help you avoid unintentional build errors when updating to a new version of Swift OpenAPI Generator.
The components covered by these rules are:
-- th... | Added a suggestion that this go much higher up in the doc, just before we list what's covered by SemVer.
```suggestion
``` |
swift-openapi-generator | github_2023 | others | 450 | apple | simonjbeaumont | @@ -9,26 +9,27 @@ Swift OpenAPI Generator generates client and server Swift code from an OpenAPI d
This document outlines the API stability goals for the generator to help you avoid unintentional build errors when updating to a new version of Swift OpenAPI Generator.
The components covered by these rules are:
-- th... | ```suggestion
In contrast to the guarantees provided for the API of Swift OpenAPI Generator, the following list of behaviors are _not_ considered API, and can change without prior warning:
``` |
swift-openapi-generator | github_2023 | others | 450 | apple | simonjbeaumont | @@ -9,26 +9,27 @@ Swift OpenAPI Generator generates client and server Swift code from an OpenAPI d
This document outlines the API stability goals for the generator to help you avoid unintentional build errors when updating to a new version of Swift OpenAPI Generator.
The components covered by these rules are:
-- th... | Clearly this is correct to remove. But it would be good somewhere to advise folks to use `from: 1.0.0`. We can defer that to when we add the usual getting started snippets to the README, which are missing right now. |
swift-openapi-generator | github_2023 | others | 450 | apple | simonjbeaumont | @@ -9,26 +9,27 @@ Swift OpenAPI Generator generates client and server Swift code from an OpenAPI d
This document outlines the API stability goals for the generator to help you avoid unintentional build errors when updating to a new version of Swift OpenAPI Generator.
The components covered by these rules are:
-- th... | ```suggestion
- The SPI provided by the OpenAPIRuntime library used by generated code (marked with `@_spi(Generated)`).
``` |
swift-openapi-generator | github_2023 | others | 450 | apple | simonjbeaumont | @@ -9,26 +9,27 @@ Swift OpenAPI Generator generates client and server Swift code from an OpenAPI d
This document outlines the API stability goals for the generator to help you avoid unintentional build errors when updating to a new version of Swift OpenAPI Generator.
The components covered by these rules are:
-- th... | This cannot be true since we have an `error`, right? |
swift-openapi-generator | github_2023 | others | 449 | apple | czechboy0 | @@ -0,0 +1,88 @@
+# Tracing middleware using Swift OTel
+
+In this example we'll implement a `ClientMiddleware` and `ServerMiddleware`
+that use `swift-otel` to emit traces for requests and responses.
+
+## Overview
+
+This example extends the [HelloWorldVaporServer](../HelloWorldVaporServer)
+with a new target, `Traci... | ```suggestion
We'll use [Compose](https://docs.docker.com/compose) to run
``` |
swift-openapi-generator | github_2023 | others | 449 | apple | czechboy0 | @@ -0,0 +1,48 @@
+// swift-tools-version:5.9
+//===----------------------------------------------------------------------===//
+//
+// This source file is part of the SwiftOpenAPIGenerator open source project
+//
+// Copyright (c) 2023 Apple Inc. and the SwiftOpenAPIGenerator project authors
+// Licensed under Apache L... | ```suggestion
```
I don't think these two are actually imported in the middleware? |
swift-openapi-generator | github_2023 | others | 442 | apple | simonjbeaumont | @@ -74,4 +74,11 @@ for EXAMPLE_PACKAGE_PATH in $(find "${EXAMPLES_PACKAGE_PATH}" -maxdepth 2 -name
--scratch-path "${SHARED_SCRATCH_PATH}" \
--cache-path "${SHARED_CACHE_PATH}" \
unedit swift-openapi-generator
+
+ log "Deleting example ${EXAMPLE_PACKAGE_NAME} at ${EXAMPLE_COPY_DIR}"
+ r... | ```suggestion
log "Deleting temporary directory"
rm -rf "${TMP_DIR}"
``` |
swift-openapi-generator | github_2023 | others | 442 | apple | simonjbeaumont | @@ -47,31 +45,24 @@ for EXAMPLE_PACKAGE_PATH in $(find "${EXAMPLES_PACKAGE_PATH}" -maxdepth 2 -name
log "Overriding dependency in ${EXAMPLE_PACKAGE_NAME} to use ${PACKAGE_PATH}"
"${SWIFT_BIN}" package \
--package-path "${EXAMPLE_COPY_DIR}" \
- --scratch-path "${SHARED_SCRATCH_PATH}" \
- ... | I don't think this is necessary any more as we can see in the logs that the pipeline is run with `--rm`
```suggestion
``` |
swift-openapi-generator | github_2023 | others | 433 | apple | simonjbeaumont | @@ -0,0 +1,43 @@
+// swift-tools-version:5.9
+//===----------------------------------------------------------------------===//
+//
+// This source file is part of the SwiftOpenAPIGenerator open source project
+//
+// Copyright (c) 2023 Apple Inc. and the SwiftOpenAPIGenerator project authors
+// Licensed under Apache L... | Any reason for the platform bump? |
swift-openapi-generator | github_2023 | others | 438 | apple | czechboy0 | @@ -29,22 +29,36 @@ chain.
## Testing
-Run the client executable using: | Higher in this file you'll need to add that this is also a ServerMiddleware now, GitHub just doesn't allow me to comment there. |
swift-openapi-generator | github_2023 | others | 438 | apple | czechboy0 | @@ -0,0 +1,46 @@
+# Logging Middleware using Swift Log
+
+In this example we'll implement a `ClientMiddleware` and `ServerMiddleware`
+that use `swift-log` to log requests and responses.
+
+## Overview
+
+This example extends the [HelloWorldURLSessionClient](../HelloWorldURLSessionClient)
+with a new target, `LoggingMi... | Names need updating. |
swift-openapi-generator | github_2023 | others | 429 | apple | simonjbeaumont | @@ -0,0 +1,74 @@
+@Tutorial(time: 5) {
+ @Intro(title: "Adding OpenAPI endpoints") { | ```suggestion
@Intro(title: "Adding OpenAPI and Swagger UI endpoints") {
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
This guide explains walks through these two practices and describes how to migrate to a spec-driven development process to improve collaboration and consistency.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
Starting with an API contract and iterating on it allows developers working on both sides of the API to be involved in the API design process from the start.
Creating an OpenAPI document is no different, describing both the methods to call and the data structures of parameters and responses.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
By starting with a draft of an OpenAPI document, both server and client teams can work in parallel as they write the code necessary to implement their portion of the API, gather feedback, and propose any iterations for future versions.
After a stable version is released, take more care during iteration ... |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
An OpenAPI document supports client-side developers creating a mock server and start work on the client to provide feedback in parallel to server-side development.
Without starting with an OpenAPI document, client-side developers are frequently forced to wait to provide input about the interface.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
As a result, working from an OpenAPI specification first allows for quicker iteration than a code-driven workflow, as there is less waiting of teams for one another.
```
And I recommend merging this with the paragraph above, removing the empty line above |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
Collaborate on the API definition, as opposed to code, to less expensively iterate on the OpenAPI document.
Browse and edit OpenAPI documents using tools available in the broader OpenAPI community, with many that support syntax highlighting, autocompletion, and validation.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
Code-driven development, or in other words, writing server code first, and generating the OpenAPI document from it, is discouraged.
```
There's nothing about this swift generator that discourages it - so that part seemed redundant. |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | merge these two sentences together into a paragraph |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
While initially it can appear convenient, communications with client teams can quickly become confused without a formal description of the API.
Additionally, as multiple teams provide feedback for an API service, there is no single point of truth for all the teams to reference, which slows down iterati... |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
Code-driven development also doesn't allow client teams to prototype their components until the server developers wrote at least enough code to generate the OpenAPI document, further limiting parallelization and delaying important learnings, making feedback more difficult to integrate.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
A code-driven workflow prioritizes server-side development over client-side development, in contrast to spec-driven development, where they work as equal peers throughout the API lifecycle.
```
Recommend merging this up into the parargraph above |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
For these reasons, use or migrate to a spec-driven development workflow.
It allows all API stakeholders to work and iterate as peers.
To learn about migrating to spec-driven incrementally, check out [this later section](#Migrate-from-code-driven-to-spec-driven-development).
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | Most of this section has been arguing against against code-driven development, and this tip shifts dramatically in what it's talking about. I think it would make a lot more sense at the end of the spec-driven development section where it segues into talking about tooling available in the community. (roughly line 49 abo... |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
In comparing the two possible workflows, as yourself the following questions:
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
Publishing the source of truth is preferable to relying on transcoding from code (or other representations) to an OpenAPI document.
By inferring the specification from existing code, the resulting OpenAPI spec is often lossy and incomplete.
Even with annotated code, It can be difficult to predict the... |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
Publish the source of truth, not a representation transcoded from the source of truth.
That way, your clients can open pull requests to your OpenAPI document without having to learn how your server is implemented, nor do they need access to the source code of your server.
```
I think this is better... |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
This section is a step-by-step guide of that shows how to migrate an example service from code-driven to spec-driven development incrementally, one operation at a time.
Migrating incrementally helps reduce risk of large code changes and allows you to evaluate and improve the workflow before migrating y... |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | This whole section and below could really be it's own individual article. If you end up wanting to reference is from elsewhere, that might be a preferable setup (information wise) |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
This example starts with a [Vapor](https://github.com/vapor/vapor) server that has 3 endpoints:
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
Each request handler is responsible for three things:
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
- b. Perform any logic specific to that handler.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
The application-specific logic (b) is the core of the handler, while input (a) and output (c) handling is often repetitive code that the Swift OpenAPI Generator can generate for you.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
To take advantage of the generator, create a new OpenAPI document with no paths in it, looking like this:
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
The example above is a valid OpenAPI document that describes a service with no endpoints.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
Save the initial spec to `Sources/MyServer/openapi.yaml` and then follow the tutorial of configuring the Swift OpenAPI Generator for a server project: <doc:ServerSwiftPM>.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
At this point, you have two sets of endpoints, your existing 3 ones, and 0 generated once (because your OpenAPI document is still empty).
Now you can commit and push the changes, and none of your existing code should be affected.
You've taken the first spec towards spec-driven development.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
Migrate the first route, `GET /foo`, and leave the other two alone for now.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
First, add the definition for the route to the OpenAPI document, so it looks something like:
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
Comment out the first of the existing route implementations in your Vapor app:
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
When you compile the example above, you'll get a build error because the `APIProtocol` contains the requirement to implement the `getFoo` operation, but it isn't yet implemented.
Xcode will offer a Fix-it, and drop in a function stub that you can fill in:
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
Only one operation was moved over, but you test that it works and even deploy the service.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
At this point, `POST /foo` and `GET /bar` are still manually implemented, but `GET /foo` is coming from the OpenAPI document and you only had to move the business logic over.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
Repeat this for the remaining two operations, until there are no manual operations with business logic.
Endpoints that provide static content, such as css or javascript files, are not usually considered part of the API, so they don't go into an OpenAPI document.
``` |
swift-openapi-generator | github_2023 | others | 420 | apple | heckj | @@ -0,0 +1,259 @@
+# Practicing spec-driven API development
+
+Design, iterate on, and generate both client and server code from your hand-written OpenAPI document.
+
+## Overview
+
+An OpenAPI document represents a machine-readable _contract_ between a server and its clients.
+
+There are two high-level workflows of c... | ```suggestion
The end result should be something like this:
``` |
swift-openapi-generator | github_2023 | others | 431 | apple | czechboy0 | @@ -0,0 +1,118 @@
+//===----------------------------------------------------------------------===//
+//
+// This source file is part of the SwiftOpenAPIGenerator open source project
+//
+// Copyright (c) 2023 Apple Inc. and the SwiftOpenAPIGenerator project authors
+// Licensed under Apache License v2.0
+//
+// See LIC... | Since it's an actor and the parameter comes in the initializer, might make sense to also be `private let`. |
swift-openapi-generator | github_2023 | others | 431 | apple | czechboy0 | @@ -0,0 +1,118 @@
+//===----------------------------------------------------------------------===//
+//
+// This source file is part of the SwiftOpenAPIGenerator open source project
+//
+// Copyright (c) 2023 Apple Inc. and the SwiftOpenAPIGenerator project authors
+// Licensed under Apache License v2.0
+//
+// See LIC... | ```suggestion
logger.warning("Request failed. Error: \(error.localizedDescription)")
``` |
swift-openapi-generator | github_2023 | others | 431 | apple | czechboy0 | @@ -0,0 +1,50 @@
+# Client Logging Middleware using OSLog
+
+In this example we'll implement a `ClientMiddleware` that uses `OSLog` to log
+requests and responses.
+
+## Overview
+
+This example extends the [HelloWorldURLSessionClient](../HelloWorldURLSessionClient)
+with a new target, `LoggingClientMiddleware`, which ... | ```suggestion
length that is less than or equal to `maxBytes`.
``` |
swift-openapi-generator | github_2023 | others | 426 | apple | czechboy0 | @@ -0,0 +1,95 @@
+# Use a database for persistent storage
+
+In this example we'll integrate persistent state into the server by adding an
+integration to a database.
+
+## Overview
+
+This example extends the [HelloWorldVaporServer](../HelloWorldVaporServer/)
+with a trivial API to return the number of messages it has... | ```suggestion
The type that provides the API handlers has been converted to an actor and
``` |
swift-openapi-generator | github_2023 | others | 426 | apple | czechboy0 | @@ -0,0 +1,95 @@
+# Use a database for persistent storage
+
+In this example we'll integrate persistent state into the server by adding an
+integration to a database.
+
+## Overview
+
+This example extends the [HelloWorldVaporServer](../HelloWorldVaporServer/)
+with a trivial API to return the number of messages it has... | ```suggestion
We need a database running locally to use in this exercise. We'll use [Compose](https://docs.docker.com/compose/)
``` |
swift-openapi-generator | github_2023 | others | 426 | apple | czechboy0 | @@ -0,0 +1,95 @@
+# Use a database for persistent storage
+
+In this example we'll integrate persistent state into the server by adding an
+integration to a database.
+
+## Overview
+
+This example extends the [HelloWorldVaporServer](../HelloWorldVaporServer/)
+with a trivial API to return the number of messages it has... | ```suggestion
Then, in another Terminal window, make requests and see the database in action.
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.