Skip to content

Small corrections to the JSON article #6470

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

Closed
DartBot opened this issue Nov 1, 2012 · 9 comments
Closed

Small corrections to the JSON article #6470

DartBot opened this issue Nov 1, 2012 · 9 comments
Labels
P3 A lower priority bug or feature request
Milestone

Comments

@DartBot
Copy link

DartBot commented Nov 1, 2012

This issue was originally filed by [email protected]


I read (http://www.dartlang.org/articles/json-web-service/). Here are some small corrections:

    var url = "http://example.com/programming-languages/";
      req.open("POST", url); // POST to send data

It says "POST to send data", but I don't see any data.

    A slight issue remains. Dart Editor displays warnings with this code, because JsonObject doesn’t
    have methods such as language or targets. You could suppress the warnings by using the dynamic
    var type, but then you don’t get code completion and more useful warnings.

I think that this is no longer the case. I think the Dart Editor will now suppress the warnings if there is a noSuchMethod method.

    interface LanguageWebsite extends JsonObject

This approach won't work for deeply nested JSON will it? By the way, we switched from interfaces to abstract classes.

    Using these features together takes advantage of the type checking available in the Dart tools,
    enabling you to be confident that your code is accessing JSON data in a structured, strongly typed manner.

While it's true that you're reducing the likelihood of errors, if your interface spells stuff differently than the server does, you'll still get into trouble. Unless both your client and server are both written in Dart and both using the same interface, the potential for spelling errors still exists.

@sethladd
Copy link
Contributor

sethladd commented Nov 1, 2012

Thanks JJ. Hi Chris, are you able to make any necessary tweaks? We definitely want to fix up the change from interface to abstract class.


Set owner to [email protected].

@DartBot
Copy link
Author

DartBot commented Nov 8, 2012

This comment was originally written by @chrisbu


Sure - Sorry, I think I missed this dartbug issue while I was on holiday. I'll get on this over the weekend.

@DartBot
Copy link
Author

DartBot commented Nov 8, 2012

This comment was originally written by @chrisbu


I'm making these tweaks now, but just to check - I only see the first issue (re POST data). The other three don't exist in the current published version of the article.

@DartBot
Copy link
Author

DartBot commented Nov 8, 2012

This comment was originally written by @chrisbu


Actioned in pull req 20:
dart-archive/www.dartlang.org#20


Set owner to @sethladd.

@DartBot
Copy link
Author

DartBot commented Nov 9, 2012

This comment was originally written by [email protected]


The other three don't exist in the current published version of the article.

Great! I did spot another one:

    new LanguageWebsite()

This class no longer exists.

Chris, I'm going to assign this back to you to make that one change. If you don't have time, you can assign it back to me, and I'll do it.


Set owner to [email protected].

@sethladd
Copy link
Contributor

Added this to the M2 milestone.

@DartBot
Copy link
Author

DartBot commented Nov 10, 2012

This comment was originally written by @chrisbu


Comment #­5 Actioned in dart-archive/www.dartlang.org#23


Set owner to [email protected].

@sethladd
Copy link
Contributor

This has been merged in. Thanks Chris!


Added Fixed label.

@nicolasgarnier
Copy link
Contributor

This issue has been moved to Github as part of a migration. Please use the Issue on Github going forward: https://github.com/dart-lang/dartlang.org/issues

@DartBot DartBot added Type-Defect P3 A lower priority bug or feature request labels Aug 26, 2014
@DartBot DartBot added this to the M2 milestone Aug 26, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 A lower priority bug or feature request
Projects
None yet
Development

No branches or pull requests

3 participants