vmarchaud / jsdoc-http-plugin

Document your http endpoints with JSDoc
MIT License
40 stars 10 forks source link

Use of @typedef in @body #12

Open molinto opened 5 years ago

molinto commented 5 years ago

Hi there, thanks for your great plugin @vmarchaud.

I have a typedef of Connection:

/**
 * A connection
 * @typedef {Object} Connection
 * @property {String} address IP address
 * @property {String} description Description
 * @property {String} interface Interface
 * @property {String} name Name
 * @property {String} netmask Netmask
 * @property {String} status Status
 * @property {String} type Type (WIFI/ETH)
 * @property {boolean} [captive] Enabled captive portal
 * @property {boolean} [dhcp_enabled] DHCP Enabled
 * @property {Number} [dhcp_lease] DHCP Lease (in seconds)
 * @property {String} [dhcp_range_end] DHCP range end
 * @property {String} [dhcp_range_start] DHCP range start
 * @property {Number} [vlan_id] Vlan ID
 * @property {String} [wifi_broadcast] Wifi Broadcast
 * @property {String} [wifi_key] Wifi security key
 * @property {String} [wifi_security] Wifi security
 * @property {String} [wifi_ssid] Wifi SSID
 */

I would to use it as the @body in a jsdoc for my create function:

/**
 * @function create
 * @name create
 * @description Create a connection
 * @path {POST} /connection
 * @header {String} Authorization JWT token
 * @header {String} Content-Type application/json
 * @auth No roles / permissions required
 * @body {Connection} Connection In {@link Connection} format
 * @code {200} If the request is successful
 * @code {500} IP Address is not valid
 * @code {500} IP host address XYZ cannot be 0 or 255
 * @since 1.0.0
 * @response {myJson} response
 * @response {Object} response.data Connection created
 */

Any ideas please as its not outputting in the generated html.

Thanks Sharry

vmarchaud commented 5 years ago

I don't think it's possible to do that currently. If you find a way to do it please do not hesitate to make a PR