The Wayback Machine - https://web.archive.org/web/20200713191648/https://github.com/SwiftyJSON/SwiftyJSON/issues/459
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

Document JSON.parse() usage in README #459

Open
djdance opened this issue Feb 22, 2016 · 2 comments
Open

Document JSON.parse() usage in README #459

djdance opened this issue Feb 22, 2016 · 2 comments
Assignees

Comments

@djdance
Copy link

@djdance djdance commented Feb 22, 2016

Why there are no any notes about JSON.parse(string) in start page/manual/docs? I'd hardly found it in issues after 2 hours of search!

Please add to manual

@ldiqual ldiqual changed the title add JSON.parse() in start page manual Document JSON.parse() usage in README Nov 17, 2016
@ldiqual ldiqual added the enhancement label Nov 22, 2016
@ldiqual
Copy link
Contributor

@ldiqual ldiqual commented Nov 22, 2016

@zhigang1992 I believe you added this in #406 to parse json strings as opposed to initialize with a string value like JSON("hello") which does accept invalid json strings. Since JSON.parse is undocumented already, how would you feel about having init(jsonString: String) throws instead? It would avoid the init(object: ) confusion by making it clear you need a valid json string there. We would also throw if the data is invalid. Let me know.

@zhigang1992
Copy link
Contributor

@zhigang1992 zhigang1992 commented Nov 23, 2016

@ldiqual I think that's a good idea, we should document the crap out of it this time. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.