Skip to content

Commit

Permalink
Remove suppressInfo config option (#140)
Browse files Browse the repository at this point in the history
This is dead code and not used for anything
anymore. This also fixes some misinformation
in the docs.
  • Loading branch information
blomqma authored Feb 27, 2024
1 parent 24c2596 commit eb773dc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 29 deletions.
17 changes: 4 additions & 13 deletions docs/docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ The following options can be passed to the `docsRoute` (app router) and `docsApi
| `openApiObject` | An [OpenAPI Object](https://swagger.io/specification/#openapi-object) that can be used to override and extend the auto-generated specification. |
| `openApiJsonPath` | Path that will be used for fetching the OpenAPI spec - defaults to `/openapi.json`. This path also determines the path where this file will be generated inside the `public` folder. |
| `docsConfig` | A [Docs config](#docs-config) object for customizing the generated docs. |
| `suppressInfo` | Setting this to `true` will suppress all informational logs from Next REST Framework. Defaults to `false`. |

### [Docs config](#docs-config)

Expand All @@ -27,8 +26,8 @@ The docs config options can be used to customize the generated docs:
| `title` | Custom title, used for the visible title and HTML title. |
| `description` | Custom description, used for the visible description and HTML meta description. |
| `faviconUrl` | Custom HTML meta favicon URL. |
| `ogConfig` | [Basic customization options](https://ogp.me/#metadata) for OG meta tags. Requires the following fields: `title`, `type`, `url`, `imageUrl`. |
| `logoUrl` | A URL for a custom logo. |
| `ogConfig` | [Basic customization options](https://ogp.me/#metadata) for OG meta tags. Requires the following fields: `title`, `type`, `url`, `imageUrl`. |

### REST

Expand All @@ -43,7 +42,7 @@ The following options can be passed to the `routeHandler` (app router) and `apiR

#### [Route operations](#route-operations)

The route operation functions `routeOperation` (app router) and `apiRouteOperation` (pages router) allow you to define your API handlers for your endpoints. These functions accept an OpenAPI [Operation object](https://swagger.io/specification/#operation-object) as a parameter, that can be used to override the auto-generated specification. Calling this function allows you to chain your API handler logic with the following functions.
The route operation functions `routeOperation` (app router) and `apiRouteOperation` (pages router) allow you to define your API handlers for your endpoints. These functions accept an OpenAPI [Operation object](https://swagger.io/specification/#operation-object) as a parameter, that can be used to override the auto-generated specification. Calling this function allows you to chain your API handler logic with the following functions:

| Name | Description |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -124,14 +123,9 @@ const handler = route({

#### [RPC route handler options](#rpc-route-handler-options)

The `rpcRouteHandler` (app router) and `rpcApiRouteHandler` (pages router) functions allow the following options as the second parameter after passing your RPC operations.

| Name | Description | Required |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| `openApiPath` | An OpenAPI [Path Item Object](https://swagger.io/specification/#path-item-object) that can be used to override and extend the auto-generated specification. | `false` |
| `openApiOperation` | An OpenAPI [Path Item Object](https://swagger.io/specification/#operation-object) that can be used to override and extend the auto-generated specification. | `false` |
The `rpcRouteHandler` (app router) and `rpcApiRouteHandler` (pages router) functions allow you to define your API handlers for your RPC endpoints. These functions accept an OpenAPI [Operation object](https://swagger.io/specification/#operation-object) as a parameter, that can be used to override the auto-generated specification.

#### [RPC operations](#rpc-route-operations)
#### [RPC operations](#rpc-operations)

The `rpcOperation` function allows you to define your API handlers for your RPC endpoint. Calling this function allows you to chain your API handler logic with the following functions.

Expand Down Expand Up @@ -219,10 +213,7 @@ The `next-rest-framework validate` command is useful to have as part of the stat
A good practice is to set these in your `package.json` as both commands are needed:

```json
// package.json
...
"scripts": {
...
"generate": "next-rest-framework generate",
"validate": "next-rest-framework validate",
}
Expand Down
15 changes: 3 additions & 12 deletions packages/next-rest-framework/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ The following options can be passed to the `docsRoute` (app router) and `docsApi
| `openApiObject` | An [OpenAPI Object](https://swagger.io/specification/#openapi-object) that can be used to override and extend the auto-generated specification. |
| `openApiJsonPath` | Path that will be used for fetching the OpenAPI spec - defaults to `/openapi.json`. This path also determines the path where this file will be generated inside the `public` folder. |
| `docsConfig` | A [Docs config](#docs-config) object for customizing the generated docs. |
| `suppressInfo` | Setting this to `true` will suppress all informational logs from Next REST Framework. Defaults to `false`. |

### [Docs config](#docs-config)

Expand Down Expand Up @@ -582,7 +581,7 @@ The following options can be passed to the `routeHandler` (app router) and `apiR

#### [Route operations](#route-operations)

The route operation functions `routeOperation` (app router) and `apiRouteOperation` (pages router) allow you to define your API handlers for your endpoints. These functions accept an OpenAPI [Operation object](https://swagger.io/specification/#operation-object) as a parameter, that can be used to override the auto-generated specification. Calling this function allows you to chain your API handler logic with the following functions.
The route operation functions `routeOperation` (app router) and `apiRouteOperation` (pages router) allow you to define your API handlers for your endpoints. These functions accept an OpenAPI [Operation object](https://swagger.io/specification/#operation-object) as a parameter, that can be used to override the auto-generated specification. Calling this function allows you to chain your API handler logic with the following functions:

| Name | Description |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -663,14 +662,9 @@ const handler = route({

#### [RPC route handler options](#rpc-route-handler-options)

The `rpcRouteHandler` (app router) and `rpcApiRouteHandler` (pages router) functions allow the following options as the second parameter after passing your RPC operations.
The `rpcRouteHandler` (app router) and `rpcApiRouteHandler` (pages router) functions allow you to define your API handlers for your RPC endpoints. These functions accept an OpenAPI [Operation object](https://swagger.io/specification/#operation-object) as a parameter, that can be used to override the auto-generated specification.

| Name | Description | Required |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| `openApiPath` | An OpenAPI [Path Item Object](https://swagger.io/specification/#path-item-object) that can be used to override and extend the auto-generated specification. | `false` |
| `openApiOperation` | An OpenAPI [Path Item Object](https://swagger.io/specification/#operation-object) that can be used to override and extend the auto-generated specification. | `false` |

#### [RPC operations](#rpc-route-operations)
#### [RPC operations](#rpc-operations)

The `rpcOperation` function allows you to define your API handlers for your RPC endpoint. Calling this function allows you to chain your API handler logic with the following functions.

Expand Down Expand Up @@ -758,10 +752,7 @@ The `next-rest-framework validate` command is useful to have as part of the stat
A good practice is to set these in your `package.json` as both commands are needed:

```json
// package.json
...
"scripts": {
...
"generate": "next-rest-framework generate",
"validate": "next-rest-framework validate",
}
Expand Down
3 changes: 1 addition & 2 deletions packages/next-rest-framework/src/shared/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export const DEFAULT_CONFIG: Required<NextRestFrameworkConfig> = {
url: HOMEPAGE,
imageUrl: DEFAULT_LOGO_URL
}
},
suppressInfo: false
}
};

export const getConfig = (config?: NextRestFrameworkConfig) =>
Expand Down
2 changes: 0 additions & 2 deletions packages/next-rest-framework/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ export interface NextRestFrameworkConfig {
imageUrl: string /*! og:image */;
};
};
/*! Setting this to `true` will suppress all informational logs from Next REST Framework. Defaults to `false`. */
suppressInfo?: boolean;
}

export type BaseStatus = number;
Expand Down

0 comments on commit eb773dc

Please sign in to comment.