asznee7 / openapi-jsdoc

Generates OpenAPI 3.0 specification from JSDoc comments
MIT License
5 stars 0 forks source link

Not possible to add vendor extensions #1

Open jessevdp opened 4 years ago

jessevdp commented 4 years ago

I haven't looked into this a ton yet. But I can't seem to figure out how to get vendor extensions into the final generated specification.

So far I've tried adding a custom entry to the definitions object. But in this case it seems like the specification does not show up in the final spec at all.

{
  "definition": {
    "info": {},
    "x-tagGroups": [
      {
        "name": "General",
        "tags": [
          "items"
        ]
      }
    ]
  },
  "apis": []
}

Or by adding an @openapi JSDoc comment with the extension in it. In this case it shows up under paths, which isn't where it is supposed to go.

/**
 * @openapi
 * x-tagGroups:
 *   - name: General
 *     tags:
 *       - items
 *   - name: Models
 *     tags:
 *       - item_model
 */
jessevdp commented 4 years ago

swagger-jsdoc does seem to allow for this. So I'll use that as a workaround for now.