Skip to content

mergeAuthoredDocs

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/libs/parser-core/src/openapi/doc-annotations.ts

Layer authored sources by strength: later arguments win field by field.

Call it as mergeAuthoredDocs(docComment, annotation) — weakest first — so the explicit annotation the author published to their own API tooling always lands on top. An absent field on the stronger source never erases a present field on the weaker one, which is what lets a handler keep its JSDoc @param prose while @ApiOperation supplies the summary.

Signature

ts
function mergeAuthoredDocs(layers: Array<AuthoredDocs | undefined>): AuthoredDocs

Parameters

NameType
layers`Array<AuthoredDocs

Returns: AuthoredDocs

Was this page helpful?

Download as PDF