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

Add support for default values #103

Closed
jasonswearingen opened this issue Jun 4, 2015 · 2 comments
Closed

Add support for default values #103

jasonswearingen opened this issue Jun 4, 2015 · 2 comments
Labels
duplicate This duplicates another issue

Comments

@jasonswearingen
Copy link

For my API's JSON input parameters, I use a Class instead of an Interface because I can supply default values for fields not supplied by the user.

When using TypeDoc, those default values are not included in the generated documentation.

Currently I can workaround this by pasing the defaults into the jsdoc description. It would be very nice if Typedoc could do this automatically, perhaps using decorators to toggle this (when decorator support is added)

@jasonswearingen
Copy link
Author

example class with default values:

/** My class can be passed to my API as JSON */
export class MyClass{
/** my argument, default value of 'foo' if not supplied by user */
  public arg1:string="foo";
/** default value does not conform to type specified, but use it anyway! */
public arg2: IData=<any>{val1:22,val3:33};
}
/** a complex data type */
public interface IData{
/** numbers are nice */
val1:number;
/** strings are too */
val2:string;
}

@sebastian-lenz
Copy link
Member

Hi Jason, this feature has already been requested, please see #83. With support for decorators default values will become more important as it might be a valuable information about the used decorators.

@sebastian-lenz sebastian-lenz added the duplicate This duplicates another issue label Jun 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This duplicates another issue
Projects
None yet
Development

No branches or pull requests

2 participants