dtsgenerator icon indicating copy to clipboard operation
dtsgenerator copied to clipboard

jsdoc comments are placed after property name

Open henhal opened this issue 1 year ago • 0 comments

Is it intentional that comments for properties using another (non-primitive) schema look like this?

            resourceId: /**
             * Resource ID
             * example:
             * 6e781f03-668c-420c-82c0-06853620dc3b
             */
            ResourceId /* uuid */;

instead of like this:

            /**
             * Resource ID
             * example:
             * 6e781f03-668c-420c-82c0-06853620dc3b
             */
            resourceId: ResourceId /* uuid */;

I'm not sure I understand why. It's normal jsdoc practice to comment before properties, not between properties and their type. I understand that this may be opinionated, but for me this looks cluttered and confusing.

(Also, the fact that the uuid part (from format: uuid) comes after the type adds to the confusion even further.)

Schema:

      "ResourceId": {
        "type": "string",
        "description": "Resource ID",
        "format": "uuid",
        "example": "6e781f03-668c-420c-82c0-06853620dc3b"
      },
      "Foo": {
        "type": "object",
        "properties": {
          "resourceId": {
            "$ref": "#/ResourceId"
          }
        }
      }

henhal avatar Oct 14 '22 16:10 henhal