Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][typescript-angular] Description is missing in JSDoc with$ref #18925

Open
5 of 6 tasks
Quentigus opened this issue Jun 14, 2024 · 0 comments
Open
5 of 6 tasks

[BUG][typescript-angular] Description is missing in JSDoc with$ref #18925

Quentigus opened this issue Jun 14, 2024 · 0 comments

Comments

@Quentigus
Copy link

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
openapi-generator version

Version: 7.3.0
Regression: ?

Description

JSDoc description are not generated on $ref properties.

Actual Output
/**
 * Class based documentation
 */
export interface Object1 { 
    property: Object1;
} 

/**
 * Class based documentation
 */
export interface Object2 {
    [k: string]: unknown;
} 

Expected Output

/**
 * Class based documentation
 */
export interface Object1 { 
    /**
     * Property documentation
     */
    property: Object1;
} 

/**
 * Class based documentation
 */
export interface Object2 {
    [k: string]: unknown;
} 
Steps to reproduce
npx openapi-generator-cli generate -g typescript-angular -i ./swagger.json -o ./output`
OpenAPI declaration file content or url
{
  "swagger": "2.0",
  "info": {
    "description": "Backend",
    "version": "1.0.0",
    "title": "API"
  },
  "basePath": "/api",
  "schemes": [
    "http",
    "https"
  ],
  "paths": {
    "/sample": {
      "get": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "$ref": "#/definitions/Object1"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "Object1": {
      "type": "object",
      "description": "Class based documentation",
      "properties": {
        "property": {
          "description": "Property documentation",
          "$ref": "#/definitions/Object2"
        }
      }
    },
    "Object2": {
      "description": "Class based documentation",
      "type": "object",
      "additionalProperties": true
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant