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

jsdoc comments are placed after property name #545

Open
henhal opened this issue Oct 14, 2022 · 0 comments
Open

jsdoc comments are placed after property name #545

henhal opened this issue Oct 14, 2022 · 0 comments

Comments

@henhal
Copy link

henhal commented Oct 14, 2022

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"
          }
        }
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant