Open
Description
openapi-typescript version
7.6.1
Node.js version
22.11.0
OS + version
macOS 14.6.1
Description
the generated JSDoc comment does not include the descriptions from the nested schemas with AnyOf
Proposal PR: #2143
Reproduction
Steps to Reproduce
- define a schema with a property using
anyOf
as shown above. - run the code generation process
pnpm exec openapi-typescript ./openapi-definition.yaml -o ./schema.ts
- the resulting jsdocs comment for the property
item
lacks the nesteddescription
item?: boolean | string;
Example openapi-definition.yaml
openapi: 3.0.0
info:
title: Sample API
description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
version: 0.1.9
servers:
- url: http://api.example.com/v1
description: Optional server description, e.g. Main (production) server
- url: http://staging-api.example.com
description: Optional server description, e.g. Internal staging server for testing
paths:
/users:
get:
summary: Returns a list of users.
description: Optional extended description in CommonMark or HTML.
responses:
"200": # status code
description: A JSON object containing user names
content:
application/json:
schema:
type: object
properties:
item:
oneOf:
- type: boolean
description: Description 1
- type: string
description: Description 2
required:
- item
Expected result
expected result is:
/** @description description 1 | description 2 */
item?: string | boolean;
Required
- My OpenAPI schema is valid and passes the Redocly validator (
npx @redocly/cli@latest lint
)
Extra
- I’m willing to open a PR (see CONTRIBUTING.md)