Skip to content

Commit 2970f74

Browse files
authored
docs(readme): spelling and grammar fixes (#853)
Signed-off-by: Frazer Smith <[email protected]>
1 parent 1ea275f commit 2970f74

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

README.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
[![CI](https://github.com/fastify/fastify-swagger/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/fastify-swagger/actions/workflows/ci.yml)
55
[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)
66

7-
A Fastify plugin for serving [Swagger (OpenAPI v2)](https://swagger.io/specification/v2/) or [OpenAPI v3](https://swagger.io/specification) schemas, which are automatically generated from your route schemas, or from an existing Swagger/OpenAPI schema.
7+
A Fastify plugin for serving [Swagger (OpenAPI v2)](https://swagger.io/specification/v2/) or [OpenAPI v3](https://swagger.io/specification) schemas, which are automatically generated from your route schemas, or an existing Swagger/OpenAPI schema.
88

99
If you are looking for a plugin to generate routes from an existing OpenAPI schema, check out [fastify-openapi-glue](https://github.com/seriousme/fastify-openapi-glue).
1010

11-
Following plugins serve Swagger/OpenAPI front-ends based on the swagger definitions generated by this plugin:
11+
The following plugins serve Swagger/OpenAPI front-ends based on the swagger definitions generated by this plugin:
1212

1313
- [@fastify/swagger-ui](https://github.com/fastify/fastify-swagger-ui)
1414
- [@scalar/fastify-api-reference](https://github.com/scalar/scalar/tree/main/packages/fastify-api-reference)
1515

16-
See also [the migration guide](MIGRATION.md) for migrating from `@fastify/swagger` version <= `<=7.x` to version `>=8.x`.
16+
See [the migration guide](MIGRATION.md) for migrating from `@fastify/swagger` version <= `<=7.x` to version `>=8.x`.
1717

1818
<a name="install"></a>
1919
## Install
@@ -43,7 +43,7 @@ See [Fastify's LTS policy](https://github.com/fastify/fastify/blob/main/docs/Ref
4343
<a name="usage"></a>
4444
## Usage
4545

46-
Add it to your project with `register`, pass it some options, call the `swagger` API, and you are done! Below an example of how to configure the OpenAPI v3 specification with Fastify Swagger:
46+
Add it to your project with `register`, pass it some options, call the `swagger` API, and you are done! Below is an example of how to configure the OpenAPI v3 specification with Fastify Swagger:
4747

4848
```js
4949
const fastify = require('fastify')()
@@ -135,7 +135,7 @@ fastify.swagger()
135135
<a name="usage.fastify.autoload"></a>
136136
### With `@fastify/autoload`
137137

138-
You need to register `@fastify/swagger` before registering routes.
138+
You need to register `@fastify/swagger` before registering routes:
139139

140140
```js
141141
const fastify = require('fastify')()
@@ -205,7 +205,7 @@ Examples of using `@fastify/swagger` in `dynamic` mode:
205205

206206
<a name="register.options.mode.static"></a>
207207
##### Static
208-
`static` mode must be configured explicitly. In this mode `@fastify/swagger` serves an already existing Swagger or OpenAPI schema that is passed to it in `specification.path`:
208+
`static` mode must be configured explicitly. In this mode, `@fastify/swagger` serves an already existing Swagger or OpenAPI schema that is passed to it in `specification.path`:
209209

210210
```js
211211
{
@@ -224,7 +224,7 @@ The `specification.postProcessor` parameter is optional. It allows you to change
224224
It accepts `swaggerObject` - a JavaScript object that was parsed from your `yaml` or `json` file and should return a Swagger schema object.
225225

226226
`specification.baseDir` allows specifying the directory where all spec files that are included in the main one using `$ref` will be located.
227-
By default, this is the directory where the main spec file is located. Provided value should be an absolute path **without** trailing slash.
227+
By default, this is the directory where the main spec file is located. The provided value should be an absolute path **without** a trailing slash.
228228

229229
An example of using `@fastify/swagger` with `static` mode enabled can be found [here](examples/static-json-file.js).
230230

@@ -246,14 +246,14 @@ An example of using `@fastify/swagger` with `static` mode enabled can be found [
246246
<a name="register.options.transform"></a>
247247
#### Transform
248248

249-
By passing a synchronous `transform` function you can modify the route's url and schema.
249+
By passing a synchronous `transform` function you can modify the route's URL and schema.
250250

251251
You may also access the `openapiObject` and `swaggerObject`
252252

253253
Some possible uses of this are:
254254

255-
- add the `hide` flag on schema according to your own logic based on url & schema
256-
- altering the route url into something that's more suitable for the api spec
255+
- add the `hide` flag on schema according to your own logic based on URL & schema
256+
- altering the route URL into something that is more suitable for the API spec
257257
- using different schemas such as [Joi](https://github.com/hapijs/joi) and transforming them to standard JSON schemas expected by this plugin
258258
- hiding routes based on version constraints
259259

@@ -315,7 +315,7 @@ If both a global and a local transform function is available for an endpoint, th
315315
The local transform function can be useful if you:
316316
317317
- want to add additional information to a specific endpoint
318-
- have an endpoint which requires different transformation from other endpoints
318+
- have an endpoint that requires a different transformation from other endpoints
319319
- want to entirely ignore the global transform function for one endpoint
320320
321321
The endpoint-specific transform can be used to "disable" the global transform function by passing in `false` instead of a function.
@@ -340,7 +340,7 @@ await fastify.register(require('@fastify/swagger'), {
340340
#### Managing your `$ref`s
341341
342342
When this plugin is configured as `dynamic` mode, it will resolve all `$ref`s in your application's schemas.
343-
This process will create an new in-line schema that is going to reference itself.
343+
This process will create a new in-line schema that is going to reference itself.
344344
345345
This logic step is done to make sure that the generated documentation is valid, otherwise the Swagger UI will try to fetch the schemas from the server or the network and fail.
346346
@@ -360,7 +360,7 @@ await fastify.register(require('@fastify/swagger'), {
360360
}
361361
```
362362
363-
To deep down the `buildLocalReference` arguments, you may read the [documentation](https://github.com/Eomm/json-schema-resolver#usage-resolve-one-schema-against-external-schemas).
363+
For a deep dive into the `buildLocalReference` arguments, you may read the [documentation](https://github.com/Eomm/json-schema-resolver#usage-resolve-one-schema-against-external-schemas).
364364
365365
<a name="register.options.decorator"></a>
366366
#### Decorator
@@ -642,7 +642,7 @@ As far as arrays are concerned, the default query string parser conforms to the
642642
If you were to select `collectionFormat: "csv"`, you would have to replace the default query string parser with one that parses CSV parameter values into arrays.
643643
The same applies to the other parts of a request that OpenAPI calls "parameters" and which are not encoded as JSON in a request.
644644
645-
You can also apply different serialization `style` and `explode` as specified [here](https://swagger.io/docs/specification/serialization/#query).
645+
You can also apply a different serialization `style` and `explode` as specified [here](https://swagger.io/docs/specification/serialization/#query).
646646
647647
`@fastify/swagger` supports these options as shown in this example:
648648
@@ -846,7 +846,7 @@ Will generate this in the OpenAPI v3 schema's `paths`:
846846
}
847847
```
848848
849-
Whether `params` is not present in the schema, or a schema is not provided, parameters are automatically generated, for example:
849+
When `params` is not present in the schema, or a schema is not provided, parameters are automatically generated, for example:
850850
851851
```js
852852
fastify.route({
@@ -1150,7 +1150,7 @@ fastify.route({
11501150
11511151
11521152
## Development
1153-
In order to start development run:
1153+
To start development run:
11541154
```
11551155
npm i
11561156
npm run prepare
@@ -1164,9 +1164,9 @@ So that [swagger-ui](https://github.com/swagger-api/swagger-ui) static folder wi
11641164
11651165
#### How to work with $refs
11661166
1167-
The `/docs/json` endpoint in dynamic mode produces a single `swagger.json` file resolving all your
1167+
The `/docs/json` endpoint in dynamic mode produces a single `swagger.json` file resolving all your references.
11681168
1169-
## Acknowledgements
1169+
## Acknowledgments
11701170
11711171
This project is kindly sponsored by:
11721172
- [nearForm](https://nearform.com)

0 commit comments

Comments
 (0)