Skip to content

Commit

Permalink
Add config to always show message examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tsauerwein committed Jun 17, 2024
1 parent a884dcf commit 1548a10
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/configuration/config-modification.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface ConfigInterface {
servers?: boolean;
operations?: boolean;
messages?: boolean;
messageExamplesAlways?: boolean;
schemas?: boolean;
errors?: boolean;
};
Expand Down Expand Up @@ -45,7 +46,7 @@ interface ConfigInterface {
- **show?: Partial<ShowConfig>**

This field contains configuration responsible for rendering specific parts of the AsyncAPI component.
All except the `sidebar` fields are set to `true` by default.
All except the `sidebar` and `messageExamplesAlways` fields are set to `true` by default.

- **sidebar?: Partial<SideBarConfig>**

Expand Down
1 change: 1 addition & 0 deletions library/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface ShowConfig {
servers?: boolean;
operations?: boolean;
messages?: boolean;
messageExamplesAlways?: boolean;
schemas?: boolean;
errors?: boolean;
}
Expand Down
1 change: 1 addition & 0 deletions library/src/config/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const defaultConfig: ConfigInterface = {
servers: true,
operations: true,
messages: true,
messageExamplesAlways: false,
schemas: true,
errors: true,
},
Expand Down
1 change: 1 addition & 0 deletions library/src/containers/Messages/Messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const Messages: React.FunctionComponent = () => {
message={message}
index={idx + 1}
key={message.id()}
showExamples={config?.show?.messageExamplesAlways || false}
/>
</li>
))}
Expand Down

0 comments on commit 1548a10

Please sign in to comment.