Skip to content

Commit

Permalink
feat(openapi): support configuration via openapi (#2299)
Browse files Browse the repository at this point in the history
Co-authored-by: Pooya Parsa <[email protected]>
  • Loading branch information
hanspagel and pi0 committed Apr 3, 2024
1 parent 8b5cbc5 commit b2f22e9
Show file tree
Hide file tree
Showing 9 changed files with 2,181 additions and 349 deletions.
2 changes: 1 addition & 1 deletion build.config.ts
Expand Up @@ -24,5 +24,5 @@ export default defineBuildConfig({
},
},
},
externals: ["@nuxt/schema", "firebase-functions"],
externals: ["@nuxt/schema", "firebase-functions", "@scalar/api-reference"],
});
29 changes: 29 additions & 0 deletions docs/3.config/0.index.md
Expand Up @@ -42,6 +42,35 @@ Enable experimental features.

Enable `/_nitro/scalar` and `/_nitro/swagger` and `/_nitro/openapi.json` endpoints.

- Default: `false`

> [!IMPORTANT]
> [Scalar](https://scalar.com/) support is currently available in [nightly channel](/guide/nightly).
You can pass an object on the root level to modify your OpenAPI specification:

```js
openAPI: {
meta: {
title: 'My Awesome Project',
description: 'This might become the next big thing.',
version: '1.0'
}
}
```

If you like to customize the Scalar integration, you can [pass a configuration object](https://github.com/scalar/scalar) like this:

```js
openAPI: {
ui: {
scalar: {
theme: 'purple'
}
}
}
```

#### `wasm`

Enable WASM support
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -135,6 +135,7 @@
"devDependencies": {
"@azure/functions": "^3.5.1",
"@azure/static-web-apps-cli": "^1.1.7",
"@scalar/api-reference": "^1.20.7",
"@cloudflare/workers-types": "^4.20240402.0",
"@types/aws-lambda": "^8.10.136",
"@types/bun": "^1.0.12",
Expand Down

0 comments on commit b2f22e9

Please sign in to comment.