Skip to content

Commit be9e62e

Browse files
authored
rename JSON keys to camelCase robotframework#3730 (robotframework#3768)
* rename JSON keys to camelCase * renamed allTags to tags
1 parent aaf63ee commit be9e62e

6 files changed

Lines changed: 20 additions & 20 deletions

File tree

atest/robot/libdoc/doc_format.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,5 @@ Test Format In JSON
117117
[Arguments] ${expected} ${format} ${cli}= ${lib}=DocFormat.py
118118
${lib} = Join Path ${TESTDATADIR} ${lib}
119119
Run Libdoc And Parse Model From JSON ${cli} ${lib}
120-
Should Be Equal ${MODEL}[doc_format] ${format}
120+
Should Be Equal ${MODEL}[docFormat] ${format}
121121
Should Be Equal ${MODEL}[keywords][0][doc] ${expected}

atest/testdata/libdoc/DynamicLibrary.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.1",
55
"type": "LIBRARY",
66
"scope": "TEST",
7-
"doc_format": "HTML",
7+
"docFormat": "HTML",
88
"source": "/Source/robotframework/robotframework/atest/testdata/libdoc/DynamicLibrary.py",
99
"lineno": 7,
1010
"inits": [
@@ -578,7 +578,7 @@
578578
}
579579
],
580580
"generated": "2020-10-23 23:42:21",
581-
"all_tags": [
581+
"tags": [
582582
"hyv\u00e4\u00e4",
583583
"my",
584584
"t\u00e4gs",

doc/schema/libdoc_schema.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"doc": {
3535
"type": "string"
3636
},
37-
"doc_format": {
37+
"docFormat": {
3838
"type": "string",
3939
"enum": [
4040
"ROBOT",
@@ -52,8 +52,8 @@
5252
"type": "integer",
5353
"minimum": -1
5454
},
55-
"all_tags": {
56-
"$id": "#/properties/all_tags",
55+
"tags": {
56+
"$id": "#/properties/tags",
5757
"type": "array",
5858
"items": {
5959
"type": "string"
@@ -82,12 +82,12 @@
8282
"type",
8383
"scope",
8484
"doc",
85-
"doc_format",
85+
"docFormat",
8686
"source",
8787
"lineno",
8888
"inits",
8989
"keywords",
90-
"all_tags"
90+
"tags"
9191
],
9292
"definitions": {
9393
"keyword": {
@@ -110,7 +110,7 @@
110110
"args": {
111111
"type": "array",
112112
"items": {
113-
"$ref": "#/definitions/keyword_arg"
113+
"$ref": "#/definitions/keywordArg"
114114
}
115115
},
116116
"doc": {
@@ -138,8 +138,8 @@
138138
}
139139
}
140140
},
141-
"keyword_arg": {
142-
"$id": "#/definitions/keyword_arg",
141+
"keywordArg": {
142+
"$id": "#/definitions/keywordArg",
143143
"type": "object",
144144
"required": [
145145
"name",

src/robot/htmldata/libdoc/libdoc.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ <h1>Opening library documentation failed</h1>
5959
selectedTag = params["tag"];
6060
tagSearch(selectedTag, window.location.hash);
6161
}
62-
if (libdoc.all_tags.length) {
62+
if (libdoc.tags.length) {
6363
libdoc.selectedTag = selectedTag;
6464
renderTemplate('tags-shortcuts', libdoc);
6565
}
@@ -138,7 +138,7 @@ <h1>Opening library documentation failed</h1>
138138
});
139139
renderTemplate('keyword-shortcuts', result);
140140
renderTemplate('keywords', result);
141-
if (libdoc.all_tags.length) {
141+
if (libdoc.tags.length) {
142142
libdoc.selectedTag = include.tagsExact ? pattern : "";
143143
renderTemplate('tags-shortcuts', libdoc);
144144
}
@@ -224,7 +224,7 @@ <h1>Opening library documentation failed</h1>
224224
function resetKeywords() {
225225
renderTemplate('keyword-shortcuts', libdoc);
226226
renderTemplate('keywords', libdoc);
227-
if (libdoc.all_tags.length) {
227+
if (libdoc.tags.length) {
228228
renderTemplate('tags', libdoc);
229229
}
230230
document.getElementById("keyword-statistics-header").innerText = ''+libdoc.keywords.length;
@@ -343,7 +343,7 @@ <h4>Documentation</h4>
343343
<input placeholder="Search" type="text" class="search-input" onkeyup="delay(searching, 500)"/>
344344
<button class="clear-search" onclick="clearSearch()">&#10005;</button>
345345
</div>
346-
{{if all_tags.length}}
346+
{{if tags.length}}
347347
<select id="tags-shortcuts-container" onchange="location = this.value;">
348348
</select>
349349
{{/if}}
@@ -382,7 +382,7 @@ <h4>Keywords (<span id="keyword-statistics-header"></span>)</h4>
382382

383383
<script type="text/x-jquery-tmpl" id="tags-shortcuts-template">
384384
<option value="javascript:clearTagSearch()" {{if selectedTag === ""}}selected{{/if}}>- Show all tags -</option>
385-
{{each all_tags}}
385+
{{each tags}}
386386
<option value="javascript:tagSearch('${$value}')" {{if selectedTag === $value}}selected{{/if}}>${$value}</a>
387387
</option>
388388
{{/each}}
@@ -437,7 +437,7 @@ <h4>Arguments</h4>
437437
</div>
438438
</div>
439439
{{/if}}
440-
{{if libdoc.all_tags.length}}
440+
{{if libdoc.tags.length}}
441441
<div class="tags">
442442
<h4>Tags</h4>
443443
{{each tags}}

src/robot/libdocpkg/jsonbuilder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def build_from_dict(self, spec):
3434
version=spec['version'],
3535
type=spec['type'],
3636
scope=spec['scope'],
37-
doc_format=spec['doc_format'],
37+
doc_format=spec['docFormat'],
3838
source=spec['source'],
3939
lineno=int(spec.get('lineno', -1)))
4040
libdoc.inits = [self._create_keyword(kw) for kw in spec['inits']]

src/robot/libdocpkg/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ def to_dictionary(self):
101101
'version': self.version,
102102
'type': self.type,
103103
'scope': self.scope,
104-
'doc_format': self.doc_format,
104+
'docFormat': self.doc_format,
105105
'source': self.source,
106106
'lineno': self.lineno,
107107
'inits': [init.to_dictionary() for init in self.inits],
108108
'keywords': [kw.to_dictionary() for kw in self.keywords],
109109
'generated': get_timestamp(daysep='-', millissep=None),
110-
'all_tags': list(self.all_tags)
110+
'tags': list(self.all_tags)
111111
}
112112

113113
def to_json(self, indent=None):

0 commit comments

Comments
 (0)