Skip to content

Commit 9a7aa50

Browse files
authored
Merge pull request #12 from jy95/moreOptions
More config
2 parents a6beb2a + a5cee1f commit 9a7aa50

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3035
-211
lines changed

README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ npm install docusaurus-json-schema-plugin --prefer-dedupe
3737

3838
> ⚠️ Why `--prefer-dedupe` ? Because of [Invalid Hook Call Warning](https://reactjs.org/warnings/invalid-hook-call-warning.html) common issue in projets
3939
40-
## Configuring `docusaurus.config.js`
40+
### Configuring `docusaurus.config.js`
4141

4242
```js
4343
// docusaurus.config.js
@@ -48,6 +48,20 @@ npm install docusaurus-json-schema-plugin --prefer-dedupe
4848

4949
```
5050

51+
### Configuring website `tsconfig.json`
52+
53+
```jsonc
54+
{
55+
"extends": "@tsconfig/docusaurus/tsconfig.json",
56+
"compilerOptions": {
57+
"baseUrl": ".",
58+
"resolveJsonModule": true,
59+
// Extending "@tsconfig/docusaurus/tsconfig.json".types with "docusaurus-json-schema-plugin"
60+
"types": ["node", "@docusaurus/module-type-aliases", "@docusaurus/theme-classic", "docusaurus-json-schema-plugin"]
61+
}
62+
}
63+
```
64+
5165
## Usage
5266

5367
### JSONSchemaViewer
@@ -56,10 +70,11 @@ npm install docusaurus-json-schema-plugin --prefer-dedupe
5670
5771
#### API
5872

59-
| Property | Type | Required | Note |
60-
|-----------------|---------------|-----------|---------------------------------------------------------|
61-
| schema | JSONSchema | Mandatory | JSON Schema Draft-07 / Draft 2019-09 / Draft 2020-12 |
62-
| resolverOptions | IResolveOpts | Optional | To resolve your $ref (by default, only inline references will be dereferenced). More info on [@stoplight/json-ref-resolver](https://github.com/stoplightio/json-ref-resolver) |
73+
| Property | Type | Required ? | Note |
74+
|-----------------|---------------|-------------|---------------------------------------------------------|
75+
| schema | JSONSchema | Mandatory | JSON Schema Draft-07 / Draft 2019-09 / Draft 2020-12 |
76+
| resolverOptions | IResolveOpts | Optional | To resolve your $ref (by default, only inline references will be dereferenced). More info on [@stoplight/json-ref-resolver](https://github.com/stoplightio/json-ref-resolver) |
77+
| viewerOptions | JSVOptions | Optional | Options for the viewer itself. More info on [Typescript type](/src/theme/JSONSchemaViewer/contexts/jsvOptions.tsx) |
6378

6479
<details open>
6580
<summary><h4>Example</h4></summary>
@@ -110,10 +125,10 @@ function ExamplePage(): JSX.Element {
110125
111126
#### API
112127

113-
| Property | Type | Required | Note |
114-
|-----------------|-------------------|-----------|----------------------------------------------------|
115-
| schema | JSONSchema | Mandatory | JSON Schema supported by [monaco-editor](https://github.com/microsoft/monaco-editor), which powers [VS Code](https://code.visualstudio.com/Docs/languages/json#_json-schemas-and-settings) - Currently, it supports all draft versions from Draft 4 to JSON Schema Draft 2020-12 |
116-
| .... | MonacoEditorProps | Optional | [Properties](https://github.com/react-monaco-editor/react-monaco-editor#properties) of [react-monaco-editor](https://github.com/react-monaco-editor/react-monaco-editor) |
128+
| Property | Type | Required ? | Note |
129+
|-----------------|-------------------|-------------|----------------------------------------------------|
130+
| schema | JSONSchema | Mandatory | JSON Schema supported by [monaco-editor](https://github.com/microsoft/monaco-editor), which powers [VS Code](https://code.visualstudio.com/Docs/languages/json#_json-schemas-and-settings) - Currently, it supports all draft versions from Draft 4 to JSON Schema Draft 2020-12 |
131+
| .... | MonacoEditorProps | Optional | [Properties](https://github.com/react-monaco-editor/react-monaco-editor#properties) of [react-monaco-editor](https://github.com/react-monaco-editor/react-monaco-editor) |
117132

118133
<details open>
119134
<summary><h4>Example</h4></summary>

0 commit comments

Comments
 (0)