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

Empty description attribute causes codegenerators to make empty comments #2035

Closed
FireRedDev opened this issue Jan 11, 2023 · 1 comment
Closed
Labels
invalid This doesn't seem right

Comments

@FireRedDev
Copy link

FireRedDev commented Jan 11, 2023

Describe the bug

When converting Javadoc to Swagger springdoc-openapi-javadoc generates the description attribute for every class even without any javadoc present in the class and leaves it empty. This causes generators like https://openapi-generator.tech/ to generate empty comments on our entities/dtos in our angular http client code generated automatically. Please dont include the property if its an empty string.

To Reproduce
Steps to reproduce the behavior: Generate Swagger JSON using URL for a Class without JavaDoc

  • What version of spring-boot you are using?
  • What modules and versions of springdoc-openapi are you using?
        <org.springdoc.version>1.6.13</org.springdoc.version>
- <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-ui</artifactId>
            <version>${org.springdoc.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-javadoc</artifactId>
            <version>1.6.13</version>
        </dependency>
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-data-rest</artifactId>
            <version>${org.springdoc.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-security</artifactId>
            <version>${org.springdoc.version}</version>
        </dependency>
  • What is the actual and the expected result using OpenAPI Description (yml or json)?
  • Provide with a sample code (HelloController) or Test that reproduces the problem

 "AddressAdditionDto": {
        "type": "object",
        "properties": {
          "addition": {
            "type": "string"
          },
          "addressId": {
            "type": "integer",
            "format": "int64"
          },
          "shoppingCartId": {
            "type": "integer",
            "format": "int64"
          }
        },
        "description": ""
      },

Expected behavior


 "AddressAdditionDto": {
        "type": "object",
        "properties": {
          "addition": {
            "type": "string"
          },
          "addressId": {
            "type": "integer",
            "format": "int64"
          },
          "shoppingCartId": {
            "type": "integer",
            "format": "int64"
          }
        }
      },

Screenshots

MicrosoftTeams-image (10)

@bnasslahsen
Copy link
Contributor

@FireRedDev,

This is not reproducible.
By default, al empty descriptions in springdoc-openapi are ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants