@scalar/fastify-api-reference 1.31.12 → 1.31.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +2 -67
- package/dist/js/standalone.js +11616 -11603
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @scalar/fastify-api-reference
|
|
2
2
|
|
|
3
|
+
## 1.31.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 161733e: docs: new README
|
|
8
|
+
|
|
9
|
+
## 1.31.14
|
|
10
|
+
|
|
11
|
+
## 1.31.13
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [291f09d]
|
|
16
|
+
- @scalar/openapi-parser@0.18.0
|
|
17
|
+
|
|
3
18
|
## 1.31.12
|
|
4
19
|
|
|
5
20
|
## 1.31.11
|
package/README.md
CHANGED
|
@@ -5,74 +5,9 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/@scalar/fastify-api-reference)
|
|
6
6
|
[](https://discord.gg/scalar)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## Documentation
|
|
9
9
|
|
|
10
|
-
[
|
|
11
|
-
|
|
12
|
-
## Installation
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npm install @scalar/fastify-api-reference
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
And then register it with Fastify:
|
|
19
|
-
|
|
20
|
-
```ts
|
|
21
|
-
await fastify.register(import('@scalar/fastify-api-reference'), {
|
|
22
|
-
routePrefix: '/reference',
|
|
23
|
-
})
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
If you have a OpenAPI/Swagger document already, you can pass an URL to the plugin:
|
|
29
|
-
|
|
30
|
-
```ts
|
|
31
|
-
// Render an API reference for a given OpenAPI/Swagger spec URL
|
|
32
|
-
fastify.register(import('@scalar/fastify-api-reference'), {
|
|
33
|
-
routePrefix: '/reference',
|
|
34
|
-
configuration: {
|
|
35
|
-
title: 'Our API Reference',
|
|
36
|
-
url: '/openapi.json',
|
|
37
|
-
},
|
|
38
|
-
})
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
With [@fastify/swagger], we’re picking it up automatically, so this would be enough:
|
|
42
|
-
|
|
43
|
-
```ts
|
|
44
|
-
await fastify.register(import('@scalar/fastify-api-reference'), {
|
|
45
|
-
routePrefix: '/reference',
|
|
46
|
-
})
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
We wrote a [detailed integration guide for Fastify](https://github.com/scalar/scalar/tree/main/documentation/integrations/fastify.md).
|
|
50
|
-
|
|
51
|
-
The fastify plugin takes our universal configuration object, [read more about configuration](https://github.com/scalar/scalar/tree/main/documentation/configuration.md) in the core package README.
|
|
52
|
-
|
|
53
|
-
## Themes
|
|
54
|
-
|
|
55
|
-
By default, we’re using a custom Fastify theme and it’s beautiful. But you can choose [one of our other themes](https://github.com/scalar/scalar/tree/main/packages/themes), too:
|
|
56
|
-
|
|
57
|
-
```ts
|
|
58
|
-
await fastify.register(import('@scalar/fastify-api-reference'), {
|
|
59
|
-
routePrefix: '/reference',
|
|
60
|
-
configuration: {
|
|
61
|
-
theme: 'purple',
|
|
62
|
-
},
|
|
63
|
-
})
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Logging
|
|
67
|
-
|
|
68
|
-
The plugin is compatible with the Fastify logger. You can configure the log level for the routes registered by the plugin:
|
|
69
|
-
|
|
70
|
-
```ts
|
|
71
|
-
fastify.register(import('@scalar/fastify-api-reference'), {
|
|
72
|
-
routePrefix: '/reference',
|
|
73
|
-
logLevel: 'silent',
|
|
74
|
-
})
|
|
75
|
-
```
|
|
10
|
+
[Read the documentation here](https://guides.scalar.com/scalar/scalar-api-references/integrations/fastify)
|
|
76
11
|
|
|
77
12
|
## Community
|
|
78
13
|
|