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

support functions from comments #25

Closed
jon49 opened this issue Mar 30, 2015 · 1 comment
Closed

support functions from comments #25

jon49 opened this issue Mar 30, 2015 · 1 comment

Comments

@jon49
Copy link
Contributor

jon49 commented Mar 30, 2015

Would it be possible to create a function in the comments?

e.g.,

/**
* @default [Function Date.now]
*/

The use case, I'm using the json-schema results to convert to mongoose schema and wanted the current date as the default. Currently it outputs the following:

{ default: "[Function" }

Let me know if you want me to take the deep dive into your code and do a pull request.

@jon49
Copy link
Contributor Author

jon49 commented Mar 31, 2015

I was reading that JSON doesn't support functions. So, I just did the following for functions:

/**
* @default [Function=Date.now]
*/

And then I parse it correctly on my side. So, I don't think this is an issue with typson.

@jon49 jon49 closed this as completed Mar 31, 2015
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