diff --git a/docs/composables/useTheme.md b/docs/composables/useTheme.md index 6d7a1bd5..f749454e 100644 --- a/docs/composables/useTheme.md +++ b/docs/composables/useTheme.md @@ -91,6 +91,7 @@ export default { avoidCirculars: false, // Avoid circular references when parsing schemas. lazyRendering: false, // Lazy render Paths and Tags components. defaultTag: 'Default', // Default tag to use when a path has no tags. + wrapExamples: true, // Wrap examples in a row or show them in a column. }, }) } @@ -153,4 +154,4 @@ export default { | Function | Description | Default Value | Allowed Values | |-----------------|------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------| -| `setSpecConfig` | Sets the spec configuration. | `{ groupByTags: true, collapsePaths: false, showPathsSummary: true, avoidCirculars: false, lazyRendering: false, defaultTag: 'Default' }` | `{ groupByTags: boolean, collapsePaths: boolean, showPathsSummary: boolean, avoidCirculars: boolean, lazyRendering: boolean, defaultTag: string }` | +| `setSpecConfig` | Sets the spec configuration. | `{ groupByTags: true, collapsePaths: false, showPathsSummary: true, avoidCirculars: false, lazyRendering: false, defaultTag: 'Default', wrapExamples: true }` | `{ groupByTags: boolean, collapsePaths: boolean, showPathsSummary: boolean, avoidCirculars: boolean, lazyRendering: boolean, defaultTag: string, wrapExamples: boolean }` | diff --git a/src/components/Parameter/OAParameter.vue b/src/components/Parameter/OAParameter.vue index 3b1871d5..a638f3d7 100644 --- a/src/components/Parameter/OAParameter.vue +++ b/src/components/Parameter/OAParameter.vue @@ -2,6 +2,7 @@ import OACodeValue from '../Common/OACodeValue.vue' import { getConstraints } from '../../lib/constraintsParser' import { getExamples } from '../../lib/getExamples' +import { useTheme } from '../../composables/useTheme' const props = defineProps({ parameter: { @@ -13,6 +14,8 @@ const props = defineProps({ const examples = getExamples(props.parameter) const constraints = getConstraints(props.parameter.schema) + +const wrapExamples = useTheme().getWrapExamples()