Skip to content

Commit

Permalink
Update all JSONSchemaViewer to use resolverOptions
Browse files Browse the repository at this point in the history
This change ensures external json schemas can be expanded by default

Signed-off-by: Jeremy Ho <jujaga@gmail.com>
  • Loading branch information
jujaga committed Jan 4, 2025
1 parent 82d4dbb commit 6c4e2ce
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
7 changes: 6 additions & 1 deletion docs/spec/data/code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import JSONSchemaViewer from "@theme/JSONSchemaViewer";
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

import { generateResolverOptions } from "@site/src/components/shared";
import schema from "@site/docs/spec/data/code.schema.json";

Indicates that the value is taken from a set of controlled strings defined elsewhere. Technically, a code is restricted
Expand All @@ -28,7 +29,11 @@ Type: `string`

<Tabs queryString="tab">
<TabItem value="schema" label="Schema" default>
<JSONSchemaViewer schema={schema} viewerOptions={{ showExamples: true }} />
<JSONSchemaViewer
resolverOptions={generateResolverOptions({ "remote": true })}
schema={schema}
viewerOptions={{ showExamples: true }}
/>
</TabItem>
<TabItem value="source" label="Source">
<CodeBlock language="json" showLineNumbers>
Expand Down
7 changes: 6 additions & 1 deletion docs/spec/data/event.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import JSONSchemaViewer from "@theme/JSONSchemaViewer";
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

import { generateResolverOptions } from "@site/src/components/shared";
import exampleDateRange from "@site/docs/spec/data/event.example.date_range.json";
import exampleDateStart from "@site/docs/spec/data/event.example.date_start.json";
import exampleDateTimeRange from "@site/docs/spec/data/event.example.datetime_range.json";
Expand Down Expand Up @@ -44,7 +45,11 @@ and context of an event will be dependent on which [resource type](../../categor

<Tabs queryString="tab">
<TabItem value="schema" label="Schema" default>
<JSONSchemaViewer schema={schema} viewerOptions={{ showExamples: true }} />
<JSONSchemaViewer
resolverOptions={generateResolverOptions({ "remote": true })}
schema={schema}
viewerOptions={{ showExamples: true }}
/>
</TabItem>
<TabItem value="source" label="Source">
<CodeBlock language="json" showLineNumbers>
Expand Down
7 changes: 6 additions & 1 deletion docs/spec/data/parcel_id.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import JSONSchemaViewer from "@theme/JSONSchemaViewer";
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

import { generateResolverOptions } from "@site/src/components/shared";
import example from "@site/docs/spec/data/parcel_id.example.json";
import schema from "@site/docs/spec/data/parcel_id.schema.json";

Expand Down Expand Up @@ -42,7 +43,11 @@ The parcel identification number (PIN) is the Crown Land Registry Parcel Identif

<Tabs queryString="tab">
<TabItem value="schema" label="Schema" default>
<JSONSchemaViewer schema={schema} viewerOptions={{ showExamples: true }} />
<JSONSchemaViewer
resolverOptions={generateResolverOptions({ "remote": true })}
schema={schema}
viewerOptions={{ showExamples: true }}
/>
</TabItem>
<TabItem value="source" label="Source">
<CodeBlock language="json" showLineNumbers>
Expand Down
7 changes: 6 additions & 1 deletion docs/spec/data/process.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import JSONSchemaViewer from "@theme/JSONSchemaViewer";
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

import { generateResolverOptions } from "@site/src/components/shared";
import example from "@site/docs/spec/data/process.example.json";
import schema from "@site/docs/spec/data/process.schema.json";

Expand All @@ -36,7 +37,11 @@ Loosely taking inspiration from [HL7 Timing](https://www.hl7.org/fhir/datatypes.

<Tabs queryString="tab">
<TabItem value="schema" label="Schema" default>
<JSONSchemaViewer schema={schema} viewerOptions={{ showExamples: true }} />
<JSONSchemaViewer
resolverOptions={generateResolverOptions({ "remote": true })}
schema={schema}
viewerOptions={{ showExamples: true }}
/>
</TabItem>
<TabItem value="source" label="Source">
<CodeBlock language="json" showLineNumbers>
Expand Down
7 changes: 6 additions & 1 deletion docs/spec/data/project_bundle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import JSONSchemaViewer from "@theme/JSONSchemaViewer";
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

import { generateResolverOptions } from "@site/src/components/shared";
import example from "@site/docs/spec/data/project_bundle.example.json";
import schema from "@site/docs/spec/data/project_bundle.schema.json";

Expand All @@ -34,7 +35,11 @@ This data type is intended to represent a grouping of related permits that are r

<Tabs queryString="tab">
<TabItem value="schema" label="Schema" default>
<JSONSchemaViewer schema={schema} viewerOptions={{ showExamples: true }} />
<JSONSchemaViewer
resolverOptions={generateResolverOptions({ "remote": true })}
schema={schema}
viewerOptions={{ showExamples: true }}
/>
</TabItem>
<TabItem value="source" label="Source">
<CodeBlock language="json" showLineNumbers>
Expand Down

0 comments on commit 6c4e2ce

Please sign in to comment.