Skip to content

Commit

Permalink
docs: fix typo in scalar page
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Dec 17, 2024
1 parent 261b798 commit 41369e9
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
7 changes: 3 additions & 4 deletions docs/docs/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ It is also possible to split the configuration by using the @@Module@@:

- type: `string[]`

List of glob pattern to scan directories which contains [Services](/docs/services)
List of glob pattern to scan directories which contains [Services](/docs/providers)
or [Middlewares](/docs/middlewares).

### middlewares
Expand Down Expand Up @@ -422,7 +422,7 @@ export class Server {}
The configuration can be reused throughout your application in different ways.

- With dependency injection in [Controller](/docs/controllers), [Middleware](/docs/middlewares)
, [Pipe](/docs/pipes) or any [Injectable](/docs/services) services.
, [Pipe](/docs/pipes) or any [Injectable](/docs/providers) services.
- With the decorators @@Constant@@ and @@Value@@.

### From service (DI)
Expand All @@ -440,9 +440,8 @@ export class MyService {

Decorators @@Constant@@ and @@Value@@ can be used in all classes including:

- [Provider](/docs/providers),
- [Provider & Service](/docs/providers),
- [Interceptor](/docs/interceptors),
- [Service](/docs/services),
- [Controller](/docs/controllers),
- [Middleware](/docs/middlewares).

Expand Down
18 changes: 9 additions & 9 deletions docs/tutorials/scalar.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ When using helmet, there may be a problem with CSP, to solve this collision, con
directives: {
defaultSrc: [`'self'`],
styleSrc: [`'self'`, `'unsafe-inline'`],
imgSrc: [`'self'`, "data:", "validator.swagger.io"],
imgSrc: [`'self'`, "data:", "validator.scalar.io"],
scriptSrc: [`'self'`, `https: 'unsafe-inline'`]
}
}
Expand Down Expand Up @@ -75,14 +75,14 @@ Some options are available to configure Scalar, Ts.ED and the default spec infor
| -------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| path | `/api-doc` | The url subpath to access to the documentation. |
| specVersion | `3.0.1` | The OpenSpec version. |
| fileName | `swagger.json` | Swagger file name. By default swagger.json. |
| doc | `hidden-doc` | The documentation key used by `@Docs` decorator to create several swagger documentations. |
| fileName | `openapi.json` | OpenAPI file name. By default openapi.json. |
| doc | `hidden-doc` | The documentation key used by `@Docs` decorator to create several openapi documentations. |
| viewPath | `${rootDir}/views/scalar.ejs` or `false` | The path to the ejs template. Set false to disabled scalar. |
| cssPath | `${rootDir}/assets/scalar.css` | The path to the CSS file. |
| showExplorer | `true` | Display the search field in the navbar. |
| spec | `{swagger: "2.0"}` | The default information spec. |
| specPath | `${rootDir}/spec/swagger.base.json` | Load the base spec documentation from the specified path. |
| outFile | `${rootDir}/spec/swagger.json` | Write the `swagger.json` spec documentation on the specified path. |
| spec | `{openapi: "3.1.0"}` | The default information spec. |
| specPath | `${rootDir}/spec/openapi.base.json` | Load the base spec documentation from the specified path. |
| outFile | `${rootDir}/spec/openapi.json` | Write the `openapi.json` spec documentation on the specified path. |
| hidden | `true` | Hide the documentation in the dropdown explorer list. |
| options | Scalar options | Scalar options. See (https://github.com/scalar/scalar/tree/main/packages/api-reference#props) |
| operationIdFormatter | `(name: string, propertyKey: string, path: string) => string` | A function to generate the operationId. |
Expand All @@ -94,7 +94,7 @@ Some options are available to configure Scalar, Ts.ED and the default spec infor

#### By decorators

It's also possible to create several swagger documentations with the `doc` option:
It's also possible to create several openapi documentations with the `doc` option:

<<< @/tutorials/snippets/scalar/multi-spec.ts

Expand All @@ -109,10 +109,10 @@ You can use the `pathPatterns` options to include only controllers whose paths m
```typescript
import {Configuration} from "@tsed/common";
import "@tsed/platform-express";
import "@tsed/scalar"; // import swagger Ts.ED module
import "@tsed/scalar"; // import scalar Ts.ED module

@Configuration({
swagger: [
scalar: [
{
path: "/api-admin",
pathPatterns: ["/rest/admin/**"]
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/snippets/scalar/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import "@tsed/platform-express";
import "@tsed/swagger"; // import swagger Ts.ED module
import "@tsed/scalar"; // import swagger Ts.ED module

import {Configuration} from "@tsed/di";

@Configuration({
swagger: [
scalar: [
{
path: "/doc",
specVersion: "3.0.1"
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/snippets/scalar/multi-spec-controllers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Controller} from "@tsed/di";
import {Docs} from "@tsed/swagger";
import {Docs} from "@tsed/scalar";

@Controller("/calendars")
@Docs("api-v2") // display this controllers only for api-docs-v2
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/snippets/scalar/multi-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "@tsed/platform-express";
import "@tsed/swagger"; // import swagger Ts.ED module
import "@tsed/scalar"; // import scalar Ts.ED module

import {Configuration} from "@tsed/di";

Expand Down
2 changes: 1 addition & 1 deletion packages/di/src/common/services/InjectorService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export class InjectorService extends Container {
}

/**
* Emit an event to all service. See service [lifecycle hooks](/docs/services.md#lifecycle-hooks).
* Emit an event to all service. See service [lifecycle hooks](/docs/hooks.md#lifecycle-hooks).
* @param eventName The event name to emit at all services.
* @param args List of the parameters to give to each service.
* @returns A list of promises.
Expand Down

0 comments on commit 41369e9

Please sign in to comment.