DescriptionSupport JSON Schema properties with values in the JSON Schema Compiler.
This brings the Extension IDL Schema feature set closer to the JSON Schema
feature set. In particular, the MDNS API needs this functionality.
Unfortunately the PPAPI IDL parser doesn't support WebIDL's "const" keyword,
which would be the right way to do this. Instead we fake it (though, consistent
with functions and events); to define a JSON Schema property, IDL Schemas
declare a 'Properties' namespace populated with no-argument functions,
annotating each function with the value they should be mapped to.
For example, this IDL:
namespace myApi {
interface Properties {
// A constant.
[value=42] static long someConstant();
};
};
will generate this JSON Schema:
{
"namespace": "myApi",
"properties": {
"someConstant": {
"value": "42",
"description": "A constant",
"type": "integer",
}
}
}
and finally, an integer myApi::some_constant equal to 42 in C++.
R=rdevlin.cronin@chromium.org
Committed: https://crrev.com/d94f954f5e1c32e7be85e2ba835a143fd388a0d8
Cr-Commit-Position: refs/heads/master@{#323401}
Patch Set 1 #Patch Set 2 : . #Patch Set 3 : better factoring / testing #
Total comments: 15
Patch Set 4 : comments #Patch Set 5 : assertr #
Messages
Total messages: 12 (2 generated)
|