8000 refactor: update scalar types · nitrojs/nitro@10c8e53 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 10c8e53

Browse files
committed
refactor: update scalar types
1 parent ddd2062 commit 10c8e53

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/runtime/internal/routes/scalar.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ReferenceConfiguration } from "@scalar/api-reference";
1+
import type { ApiReferenceConfiguration } from "@scalar/api-reference";
22
import { eventHandler } from "h3";
33
import { useRuntimeConfig } from "../config";
44

@@ -12,9 +12,11 @@ export default eventHandler((event) => {
1212

1313
// https://github.com/scalar/scalar
1414
const _config = runtimeConfig.nitro.openAPI?.ui
15-
?.scalar as ReferenceConfiguration;
16-
const scalarConfig: ReferenceConfiguration = {
15+
?.scalar as ApiReferenceConfiguration;
16+
const scalarConfig: ApiReferenceConfiguration = {
1717
..._config,
18+
url: openAPIEndpoint,
19+
// @ts-expect-error (missing types?)
1820
spec: { url: openAPIEndpoint, ..._config?.spec },
1921
};
2022

src/types/openapi.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ReferenceConfiguration as ScalarConfig } from "@scalar/api-reference";
1+
import type { ApiReferenceConfiguration as ScalarConfig } from "@scalar/api-reference";
22

33
/**
44
* Nitro OpenAPI configuration
@@ -34,7 +34,7 @@ export interface NitroOpenAPIConfig {
3434
*/
3535
scalar?:
3636
| false
37-
| (ScalarConfig & {
37+
| (Partial<ScalarConfig> & {
3838
/**
3939
* Scalar UI route
4040
*

0 commit comments

Comments
 (0)
0