diff options
author | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-31 06:38:29 +0000 |
---|---|---|
committer | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-31 06:38:29 +0000 |
commit | e685143bd7d15b048b7ca9cb4ec0240827842266 (patch) | |
tree | 74f100269c45c656a554a794d4e63749b91fe026 /tools/json_schema_compiler/model.py | |
parent | 7a29680b81b983ac1da1b5fdbe3ad096bad7015a (diff) | |
download | chromium_src-e685143bd7d15b048b7ca9cb4ec0240827842266.zip chromium_src-e685143bd7d15b048b7ca9cb4ec0240827842266.tar.gz chromium_src-e685143bd7d15b048b7ca9cb4ec0240827842266.tar.bz2 |
Revert 231982 "Docserver: Display enum value descriptions in API..."
"JsonSchemaTest.TestEnum" started failing on Windows bot after this change.
> Docserver: Display enum value descriptions in API docs.
>
> This modifies the json schema to allow both primitive types and
> dictionaries with properties "name" and optional "description" for enum
> values.
>
> BUG=310454
>
> Review URL: https://codereview.chromium.org/39113003
TBR=sammc@chromium.org
Review URL: https://codereview.chromium.org/47403003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232016 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/json_schema_compiler/model.py')
-rw-r--r-- | tools/json_schema_compiler/model.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py index 3de975c..7507ae7 100644 --- a/tools/json_schema_compiler/model.py +++ b/tools/json_schema_compiler/model.py @@ -141,7 +141,7 @@ class Type(object): self.ref_type = json['$ref'] elif 'enum' in json and json_type == 'string': self.property_type = PropertyType.ENUM - self.enum_values = [EnumValue(value) for value in json['enum']] + self.enum_values = [value for value in json['enum']] elif json_type == 'any': self.property_type = PropertyType.ANY elif json_type == 'binary': @@ -343,20 +343,6 @@ class Property(object): unix_name = property(GetUnixName, SetUnixName) -class EnumValue(object): - """A single value from an enum. - Properties: - - |name| name of the property as in the json. - - |description| a description of the property (if provided) - """ - def __init__(self, json): - if isinstance(json, dict): - self.name = json['name'] - self.description = json.get('description') - else: - self.name = json - self.description = None - class _Enum(object): """Superclass for enum types with a "name" field, setting up repr/eq/ne. Enums need to do this so that equality/non-equality work over pickling. |