-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Comments
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]. |
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. |
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. |
This comment was originally written by @chrisbu Actioned in pull req 20: Set owner to @sethladd. |
This comment was originally written by [email protected]
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]. |
Added this to the M2 milestone. |
This comment was originally written by @chrisbu Comment #5 Actioned in dart-archive/www.dartlang.org#23 Set owner to [email protected]. |
This has been merged in. Thanks Chris! Added Fixed label. |
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 |
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.
The text was updated successfully, but these errors were encountered: