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

Output JSON format spec needed #35

Closed
mik01aj opened this issue Oct 29, 2015 · 4 comments
Closed

Output JSON format spec needed #35

mik01aj opened this issue Oct 29, 2015 · 4 comments

Comments

@mik01aj
Copy link

mik01aj commented Oct 29, 2015

I have already tried 2 tools based on react-docgen and they fail on my code, because the JSON produced by react-docgen is different that they expect (for my cases, it was because there was no defaultValue or because type.value was a string). In my opinion, these bugs happen because there is no spec of the ouptput JSON format, with some good examples to test in such styleguide tools. Help would be appreciated a lot.

@fkling
Copy link
Member

fkling commented Oct 29, 2015

There is a description of the output in the README: https://github.com/reactjs/react-docgen#result-data-structure (though granted it doesn't cover possible value types for props).

The second issue you linked to seems to be a bug in react-docgen. value should be empty in that case (raw should be set instead).

@mik01aj
Copy link
Author

mik01aj commented Oct 29, 2015

@fkling thanks, I missed this description, sorry!

@mik01aj mik01aj closed this as completed Oct 29, 2015
@fkling
Copy link
Member

fkling commented Oct 29, 2015

Well, it could be more extensive maybe :)

I'd appreciate it if you could file a bug for the second issue you mentioned!

@mik01aj
Copy link
Author

mik01aj commented Oct 29, 2015

About extensiveness: I think JSON schema could help. Then you would be able to verify that the JSON you return is really what you specified, and tool debelopers could use json-schema-random to generate examples and thus make them more reliable.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants