Open mafrosis opened 8 years ago
Hmm. I think maybe that init is expected to have an argument always, though that is certainly not a very helpful error message.
I'm less certain about the encoding issue, do you have non-ascii in that schema? Could you share the schema that is causing the issue so I can work on debugging against it? Thanks!
@geemus Yah I guessed there should be some validation on the init
command :)
Here's a breaking JSON schema: I used curl
to pull down the gist, and still see the exception above:
https://gist.github.com/mafrosis/edb462ad16d05ce695c7c8018a2d1971
It may be a ruby version thing. I'm seeing an error as well, but not the same one. I think one key thing to note is that the schema you doc is expected to have gone through combine (which makes a sort of uber-schema). If you haven't combined the individual schema, doc gets confused because things are not in the places it would expect. So, I think for you it will work better if you for instance do something like:
prmd combine /schema/approve_schema.json | prmd doc
(you can also pipe the output to a file and then doc that instead of piping).
That gives me:
Meta is empty, please fill it next time.
## <a name="resource-approve_schema.json">portal_approve</a>
A description
### Attributes
| Name | Type | Description | Example |
| ------- | ------- | ------- | ------- |
| **email** | *string* | An email address | `"example"` |
| **link** | *string* | DEPRECATED. A link for the user to follow to change password | `"example"` |
| **name** | *string* | The contact's full name | `"example"` |
| **token** | *string* | The password change token (previously part of link) | `"example"` |
You can clear up the meta part by init-ing a meta file (which has top level info like the host for the API and name).
Hope that clears some things up, the error you were getting was definitely not helpful whatsoever (as unfortunately many erubis/template errors tend to be). I also got an error there, but it was at least nominally clearer (it was a no split method on nil error, guessing your error also results from a nil where a character string is expected). Anyway, I'm not sure about how to make that error better in particular, but hopefully this can help you workaround it.
Calling
prmd init
without an argument causes an exception:Then trying to generate docs from a schema, it seems that character encoding is not being handled correctly: