Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 35 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"@redocly/openapi-core": "^1.4.0",
"classnames": "^2.3.2",
"decko": "^1.2.0",
"dompurify": "^3.0.6",
"dompurify": "^3.3.0",
"eventemitter3": "^5.0.1",
"json-pointer": "^0.6.2",
"lunr": "^2.3.9",
Expand All @@ -152,7 +152,7 @@
"path-browserify": "^1.0.1",
"perfect-scrollbar": "^1.5.5",
"polished": "^4.2.2",
"prismjs": "^1.29.0",
"prismjs": "^1.30.0",
"prop-types": "^15.8.1",
"react-tabs": "^6.0.2",
"slugify": "~1.4.7",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Operation/Operation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const Operation = observer(({ operation }: OperationProps): JSX.Element =
))}
{summary} {deprecated && <Badge type="warning"> Deprecated </Badge>}
{isWebhook && (
<Badge type="primary">
<Badge type="primary" color={options.webhookBadgeColor}>
{' '}
Webhook {showWebhookVerb && httpVerb && '| ' + httpVerb.toUpperCase()}
</Badge>
Expand Down
4 changes: 2 additions & 2 deletions src/components/SideMenu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export interface OperationMenuItemContentProps {
export const OperationMenuItemContent = observer((props: OperationMenuItemContentProps) => {
const { item } = props;
const ref = React.createRef<HTMLLabelElement>();
const { showWebhookVerb } = React.useContext(OptionsContext);
const { showWebhookVerb, webhookBadgeColor } = React.useContext(OptionsContext);

React.useEffect(() => {
if (props.item.active && ref.current) {
Expand All @@ -108,7 +108,7 @@ export const OperationMenuItemContent = observer((props: OperationMenuItemConten
</OperationBadge>
))}
{item.isWebhook ? (
<OperationBadge type="hook">
<OperationBadge type="badge" color={webhookBadgeColor}>
{showWebhookVerb ? item.httpVerb : l('webhook')}
</OperationBadge>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ exports[`Components SchemaView discriminator should correctly render SchemaView
},
"unstable_ignoreMimeParameters": false,
"untrustedSpec": false,
"webhookBadgeColor": undefined,
},
"pattern": undefined,
"pointer": "#/components/schemas/Dog/properties/packSize",
Expand Down Expand Up @@ -567,6 +568,7 @@ exports[`Components SchemaView discriminator should correctly render SchemaView
},
"unstable_ignoreMimeParameters": false,
"untrustedSpec": false,
"webhookBadgeColor": undefined,
},
"pattern": undefined,
"pointer": "#/components/schemas/Dog/properties/type",
Expand Down Expand Up @@ -827,6 +829,7 @@ exports[`Components SchemaView discriminator should correctly render SchemaView
},
"unstable_ignoreMimeParameters": false,
"untrustedSpec": false,
"webhookBadgeColor": undefined,
},
"pattern": undefined,
"pointer": "#/components/schemas/Dog",
Expand Down Expand Up @@ -1149,6 +1152,7 @@ exports[`Components SchemaView discriminator should correctly render SchemaView
},
"unstable_ignoreMimeParameters": false,
"untrustedSpec": false,
"webhookBadgeColor": undefined,
},
"pattern": undefined,
"pointer": "#/components/schemas/Cat/properties/type",
Expand Down Expand Up @@ -1434,6 +1438,7 @@ exports[`Components SchemaView discriminator should correctly render SchemaView
},
"unstable_ignoreMimeParameters": false,
"untrustedSpec": false,
"webhookBadgeColor": undefined,
},
"pattern": undefined,
"pointer": "#/components/schemas/Cat/properties/packSize",
Expand Down Expand Up @@ -1690,6 +1695,7 @@ exports[`Components SchemaView discriminator should correctly render SchemaView
},
"unstable_ignoreMimeParameters": false,
"untrustedSpec": false,
"webhookBadgeColor": undefined,
},
"pattern": undefined,
"pointer": "#/components/schemas/Cat",
Expand Down Expand Up @@ -1971,6 +1977,7 @@ exports[`Components SchemaView discriminator should correctly render SchemaView
},
"unstable_ignoreMimeParameters": false,
"untrustedSpec": false,
"webhookBadgeColor": undefined,
},
"pattern": undefined,
"pointer": "#/components/schemas/Pet",
Expand Down Expand Up @@ -2282,6 +2289,7 @@ exports[`Components SchemaView discriminator should correctly render SchemaView
},
"unstable_ignoreMimeParameters": false,
"untrustedSpec": false,
"webhookBadgeColor": undefined,
},
"pattern": undefined,
"pointer": "#/components/schemas/Dog/properties/packSize",
Expand Down Expand Up @@ -2555,6 +2563,7 @@ exports[`Components SchemaView discriminator should correctly render SchemaView
},
"unstable_ignoreMimeParameters": false,
"untrustedSpec": false,
"webhookBadgeColor": undefined,
},
"pattern": undefined,
"pointer": "#/components/schemas/Dog/properties/type",
Expand Down Expand Up @@ -2815,6 +2824,7 @@ exports[`Components SchemaView discriminator should correctly render SchemaView
},
"unstable_ignoreMimeParameters": false,
"untrustedSpec": false,
"webhookBadgeColor": undefined,
},
"pattern": undefined,
"pointer": "#/components/schemas/Dog",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,12 @@ exports[`FieldDetailsComponent renders correctly when field items have string ty
class="sc-kpDqfm sc-dAlyuH sc-gvZAcH cGRfjn gHomYR eXivNJ"
>
[ items
<span>
<span
class="field-constraints"
>

<span
class="sc-kpDqfm sc-gFqAkR cGRfjn fYEICH"
class="sc-kpDqfm sc-ikkxIA cGRfjn bPXQUO"
>
&lt;= 128 characters
</span>
Expand Down
3 changes: 3 additions & 0 deletions src/services/RedocNormalizedOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface RedocRawOptions {
showObjectSchemaExamples?: boolean | string;
showSecuritySchemeType?: boolean;
hideSecuritySection?: boolean;
webhookBadgeColor?: string;

unstable_ignoreMimeParameters?: boolean;

Expand Down Expand Up @@ -244,6 +245,7 @@ export class RedocNormalizedOptions {
showObjectSchemaExamples: boolean;
showSecuritySchemeType?: boolean;
hideSecuritySection?: boolean;
webhookBadgeColor?: string;

/* tslint:disable-next-line */
unstable_ignoreMimeParameters: boolean;
Expand Down Expand Up @@ -318,6 +320,7 @@ export class RedocNormalizedOptions {
this.showObjectSchemaExamples = argValueToBoolean(raw.showObjectSchemaExamples);
this.showSecuritySchemeType = argValueToBoolean(raw.showSecuritySchemeType);
this.hideSecuritySection = argValueToBoolean(raw.hideSecuritySection);
this.webhookBadgeColor = raw.webhookBadgeColor;

this.unstable_ignoreMimeParameters = argValueToBoolean(raw.unstable_ignoreMimeParameters);

Expand Down
Loading