Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Small corrections to the JSON article #503

Closed
nicolasgarnier opened this issue Aug 26, 2014 · 8 comments
Closed

Small corrections to the JSON article #503

nicolasgarnier opened this issue Aug 26, 2014 · 8 comments
Labels
Milestone

Comments

@nicolasgarnier
Copy link
Contributor

From [email protected] on November 01, 2012 23:42:41

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.

Original issue: http://code.google.com/p/dart/issues/detail?id=6470

@nicolasgarnier nicolasgarnier added this to the M2 milestone Aug 26, 2014
@nicolasgarnier
Copy link
Contributor Author

From [email protected] on November 01, 2012 16:52:30

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.

Owner: [email protected]

@nicolasgarnier
Copy link
Contributor Author

From [email protected] on November 08, 2012 00:36:13

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

@nicolasgarnier
Copy link
Contributor Author

From [email protected] on November 08, 2012 06:02:19

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.

@nicolasgarnier
Copy link
Contributor Author

From [email protected] on November 08, 2012 06:26:50

Actioned in pull req 20: #20

Owner: [email protected]

@nicolasgarnier
Copy link
Contributor Author

From [email protected] on November 09, 2012 13:46:50

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.

Owner: [email protected]

@nicolasgarnier
Copy link
Contributor Author

From [email protected] on November 09, 2012 16:58:25

Labels: Milestone-M2

@nicolasgarnier
Copy link
Contributor Author

From [email protected] on November 10, 2012 03:42:08

Comment #5 Actioned in #23

Owner: [email protected]

@nicolasgarnier
Copy link
Contributor Author

From [email protected] on November 12, 2012 02:53:09

This has been merged in. Thanks Chris!

Status: Fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

1 participant