Home | Projects | Tutorials | Articles | live chat | Submit Project | Big Vote
 
Ajax Projects
.NET Frameworks
Java Frameworks
PHP Frameworks
Ruby Frameworks
Other Frameworks
Cool AJAX sites
Ajax Resources
Ajax Tools
JavaScript frameworks
Partners

 Home /  Tutorials / How JSON Schema is turning out for the Chrome extension APIs

How JSON Schema is turning out for the Chrome extension APIs





When Aaron talked about the Chrome extension API he mentioned how he would see if JSON Schema could help them have a JSON heavy API and allow them to easily validate.

Read The Full Tutorial.
































When Aaron talked about the Chrome extension API he mentioned how he would see if JSON Schema could help them have a JSON heavy API and allow them to easily validate.

He has quickly reported back and is happy with the results.

Something like this:


PLAIN TEXT
JAVASCRIPT:

   1.
      
   2.
      chromium.tabs.createTab = function(tab, callback) {
   3.
        validate(arguments, arguments.callee.params);
   4.
        sendRequest(CreateTab, tab, callback);
   5.
      };
   6.
      
   7.
      chromium.tabs.createTab.params = [
   8.
        {
   9.
          type: "object",
  10.
          properties: {
  11.
            windowId: chromium.types.optPInt,
  12.
            url: chromium.types.optStr,
  13.
            selected: chromium.types.optBool
  14.
          },
  15.
          additionalProperties: false
  16.
        },
  17.
        chromium.types.optFun
  18.
      ];
  19.
      

will give you errors such as:

    Invalid value for parameter 0. Property windowId: expected integer, got string.

It will be interesting to see how the APIs look when you go for this style throughout. Looking forward to see more.

source: ajaxian

neon tabela Says:
Thu Oct 22, 2009 5:05 pm
Everything is very open and very clear explanation of issues. was truly information. Your website is very useful. Thanks for sharing.
web tasarým Says:
Thu Jan 07, 2010 3:38 pm
thanks

Leave Your Comment

Name (Required)
Mail (will not be published) (required)
Website
AddThis Social Bookmark Button
Top Projects
MSN Web Messenger
MessengerFX
ebuddy
e-messenger
ILoveIM
AJAX file upload
You Tube
KoolIM.com
Meebo
Ajax.NET Professional
Tutorials
AdvancedAJAX 1.1
Animated Ajax Record Deletion Using jQuery
Intuive MVC Pattern for Ajax Applications
Webkit CSS Transforms
Developing Ajax Portlets with Eclipse WTP
Talking to .NET on the server with Jaxer
Dealing with Long Running Processes in ASP.NET
From MySQL to jQuery, via PHP, XML & Ajax
Image Gallery via Ajax using JQuery Tools
Implementing IDIsposable Interface In JavaScript