diff --git a/src/includer/traverse/description.ts b/src/includer/traverse/description.ts index c110d97..9d2d847 100644 --- a/src/includer/traverse/description.ts +++ b/src/includer/traverse/description.ts @@ -1,5 +1,4 @@ import {OpenJSONSchema} from '../models'; -import {concatNewLine} from '../utils'; type Field = { key: keyof OpenJSONSchema; @@ -92,17 +91,14 @@ function concatConstraint( constraintLabel: string, notWrapValueIntoCode = false, ) { - if (typeof constraint !== 'undefined') { - return concatNewLine( - description, - `${constraintLabel} ${prepareConstraintValue( - constraint, - notWrapValueIntoCode, - )}`, - ); + if (typeof constraint === 'undefined') { + return description; } - return description; + constraint = prepareConstraintValue(constraint, notWrapValueIntoCode); + description = description.replace(/\n$/, ''); + + return `${description}\n\n*${constraintLabel}*{.openapi-description-annotation} ${constraint}\n`; } function prepareConstraintValue(value: unknown, notWrapValueIntoCode: boolean) { diff --git a/src/runtime/index.scss b/src/runtime/index.scss index 9c50786..6e8e9d5 100644 --- a/src/runtime/index.scss +++ b/src/runtime/index.scss @@ -13,9 +13,10 @@ --dc-openapi-highlight: rgb(233, 174, 86); .openapi-description-annotation { - color: gray; + font-style: normal; + color: var(--g-color-text-hint); } - + &__required { color: var(--g-color-text-danger); } @@ -48,7 +49,7 @@ &__wrapper { position: relative; max-width: 100%; - display: inline-block; + display: inline-block; } & * {