Skip to content

Commit 60f4bd2

Browse files
committed
move the comments outside of the cat EOF blocks to avoid error with some shell + fix minor typos
1 parent 33cc99d commit 60f4bd2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This library allows to expose server side Swift OpenAPI implementation generated
1313

1414
The library provides two capabilities:
1515

16-
- a default implementation of an AWS Lambda function in that consumes your OpenAPI service implementation
16+
- a default implementation of an AWS Lambda function that consumes your OpenAPI service implementation
1717
- a binding with the [Amazon API Gateway (HTTP API mode)](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html) (aka `APIGatewayV2`) event type.
1818

1919
Other Lambda function bindings (event types) are supported as well, depending on your needs. [We include instructions](#implement-your-own-openapilambda-to-support-other-event-types) to create a binding with an [Amazon API Gateway (REST API mode)](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-rest-api.html)
@@ -121,13 +121,15 @@ swift package init --name quoteapi --type executable
121121

122122
2. Write or import an OpenAI API definition in YAML or JSON
123123

124-
```yaml
124+
```sh
125125
#
126126
# the $ signs are escaped (\$) to work with the cat << EOF command
127127
# if you choose to copy the content directly to a text editor,
128128
# be sure to remove the \ (that means \$ becomes $)
129129
#
130+
```
130131

132+
```yaml
131133
cat << EOF > Sources/openapi.yaml
132134
openapi: 3.1.0
133135
info:
@@ -296,7 +298,9 @@ swift build
296298
# if you choose to copy the content directly to a text editor,
297299
# be sure to remove the \ (that means \$ becomes $)
298300
#
301+
```
299302

303+
```sh
300304
cat << EOF > Dockerfile
301305
# image used to compile your Swift code
302306
FROM public.ecr.aws/docker/library/swift:5.9.1-amazonlinux2
@@ -355,7 +359,9 @@ EOF
355359
# if you choose to copy the content directly to a text editor,
356360
# be sure to remove the \ (that means \$ becomes $)
357361
#
362+
```
358363
364+
```sh
359365
cat << EOF > template.yml
360366
AWSTemplateFormatVersion: '2010-09-09'
361367
Transform: AWS::Serverless-2016-10-31
@@ -498,7 +504,7 @@ struct QuoteServiceImpl: APIProtocol {
498504
499505
Next, I implement a `struct` that conforms to `OpenAPILambda`. This `struct` defines:
500506
501-
- the event input and output the Lambda function will work on (from [AWS Lambda Event Types](https://github.com/swift-server/swift-aws-lambda-events) library).
507+
- the event input and output the Lambda function will work on (from [AWS Lambda Event Types](https://github.com/swift-server/swift-aws-lambda-events) library).
502508
- the mandatory constructor `init(transport:)`
503509
- the executable target entrypoint (`@main`)
504510
@@ -536,7 +542,7 @@ extension OpenAPILambda where Output == APIGatewayResponse {
536542
}
537543
```
538544
539-
To keep the above code short, simple, and readable, we suggest to implement whatever extension on the Lambda event type. Here are the extensions required to support the above code. These are simple data transformation methods from one type to the other.
545+
To keep the above code short, simple, and readable, we suggest to implement whatever extension on the Lambda source Event type. Here are the extensions required to support the above code. These are simple data transformation methods from one type to the other.
540546
541547
```swift
542548
extension APIGatewayRequest {

0 commit comments

Comments
 (0)