WEBVTT

1
00:00.000 --> 00:04.320
Alright, so we know what serialization is all about. Let's look at our first

2
00:04.320 --> 00:06.840
file format and this is going to be JSON.

3
00:06.840 --> 00:11.400
So what JSON actually stands for is JavaScript object notation.

4
00:11.400 --> 00:15.600
Now the temptation might be if you've heard of a programming language known as

5
00:15.600 --> 00:16.840
well JavaScript.

6
00:16.840 --> 00:21.030
You might suspect that JSON is only for JavaScript, but this is actually not

7
00:21.030 --> 00:21.560
the case.

8
00:21.560 --> 00:25.600
Pretty much JSON was derived from the way in which we create objects within

9
00:25.600 --> 00:26.440
JavaScript.

10
00:26.440 --> 00:30.720
But don't let that confuse you thinking that this is a JavaScript only concept.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

10
00:26.440 --> 00:30.720
But don't let that confuse you thinking that this is a JavaScript only concept.

11
00:30.720 --> 00:34.840
As we said in the previous video, utilizing things like JSON, XML, YAML.

12
00:34.840 --> 00:38.520
One of the benefits here is language neutrality. This is exactly what we're

13
00:38.520 --> 00:39.240
getting here.

14
00:39.240 --> 00:43.040
Now the first thing to state about JSON is that it is fairly human readable.

15
00:43.040 --> 00:46.240
This is obviously an advantage when we happen to store our data.

16
00:46.240 --> 00:50.080
If we can read it, then it does make it a little bit easier to work with.

17
00:50.080 --> 00:54.040
It's not quite as human readable as say, for example, YAML.

18
00:54.040 --> 00:57.680
But generally speaking, if you happen to look at a JSON document, you can get a

19
00:57.680 --> 00:58.440
good idea

20
00:58.440 --> 01:02.040
about the data that has actually been stored and how it's been stored.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

20
00:58.440 --> 01:02.040
about the data that has actually been stored and how it's been stored.

21
01:02.040 --> 01:06.620
Now quite honestly, there is a massive focus on JSON in the world of automation

22
01:06.620 --> 01:07.800
and programmability.

23
01:07.800 --> 01:11.440
The reason why is it with respect to things like REST APIs.

24
01:11.440 --> 01:14.480
Now we actually haven't talked about REST APIs quite just yet, but we'll

25
01:14.480 --> 01:15.080
definitely look

26
01:15.080 --> 01:16.320
at it very, very soon.

27
01:16.320 --> 01:20.200
When we happen to interact with REST APIs, the most common way that we're going

28
01:20.200 --> 01:20.600
to get

29
01:20.600 --> 01:24.870
your data back is in this JSON format, so it's really, really key that we

30
01:24.870 --> 01:25.760
understand how

31
01:25.760 --> 01:27.760
it operates because it's absolutely everywhere.

32
01:27.760 --> 01:29.000
It's so, so popular.

33
01:29.000 --> 01:33.680
Now, just as an aside, if you happen to recall the way Python happens to create
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

33
01:29.000 --> 01:33.680
Now, just as an aside, if you happen to recall the way Python happens to create

34
01:33.680 --> 01:34.080
particular

35
01:34.080 --> 01:37.820
objects, say for example, when we want to create a Python dictionary, we can

36
01:37.820 --> 01:38.440
use things

37
01:38.440 --> 01:39.920
like curly braces.

38
01:39.920 --> 01:42.560
If we want to create lists, we can use square brackets.

39
01:42.560 --> 01:47.480
There is a lot of similarities between JSON and regular Python objects.

40
01:47.480 --> 01:50.900
So you know the way in Python dictionaries, you specify a particular key and

41
01:50.900 --> 01:51.560
then you get

42
01:51.560 --> 01:53.240
a corresponding value.

43
01:53.240 --> 01:55.840
We have the same type of concept within JSON.

44
01:55.840 --> 01:59.520
Now let's just focus in on the actual value for a moment.

45
01:59.520 --> 02:02.720
What type of data can actually be stored as a value in JSON?
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

45
01:59.520 --> 02:02.720
What type of data can actually be stored as a value in JSON?

46
02:02.720 --> 02:05.970
Well, many of the common types that you would expect, so say for example, we

47
02:05.970 --> 02:06.520
want to store

48
02:06.520 --> 02:07.800
a string value.

49
02:07.800 --> 02:10.560
This is absolutely a valid value within JSON.

50
02:10.560 --> 02:14.060
And this is the data type you would use for words or sentences, descriptions,

51
02:14.060 --> 02:14.520
that type

52
02:14.520 --> 02:15.520
of thing.

53
02:15.520 --> 02:17.880
The next data type we can have is a number.

54
02:17.880 --> 02:21.910
Now really similar to say, for example, integers in Python, the difference

55
02:21.910 --> 02:23.320
between a number

56
02:23.320 --> 02:25.160
and a string is very, very important.

57
02:25.160 --> 02:28.600
Say, for example, you want to perform some type of mathematical calculation or

58
02:28.600 --> 02:29.280
mathematical

59
02:29.280 --> 02:30.600
evaluation.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

59
02:29.280 --> 02:30.600
evaluation.

60
02:30.600 --> 02:35.160
You want to make sure that your numerical value is not wrapped in quotations.

61
02:35.160 --> 02:40.640
So say, for example, this here is a string, whereas this here is a number.

62
02:40.640 --> 02:45.040
So say, for example, you were storing some information about your VLANs in the

63
02:45.040 --> 02:46.080
JSON documents.

64
02:46.080 --> 02:49.480
And you wanted to parse the information about the actual VLAN number.

65
02:49.480 --> 02:52.310
Now, if you were using Python, let's maybe say you wanted to write some

66
02:52.310 --> 02:53.560
conditional logic

67
02:53.560 --> 02:56.280
to run a particular check against this value.

68
02:56.280 --> 02:57.280
So what kind of check?

69
02:57.280 --> 03:01.140
Well, let's maybe say we want to ensure that our VLAN range, or rather the
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

69
02:57.280 --> 03:01.140
Well, let's maybe say we want to ensure that our VLAN range, or rather the

70
03:01.140 --> 03:01.920
number being

71
03:01.920 --> 03:04.240
used, is within a particular range.

72
03:04.240 --> 03:08.790
And we wanted to specify that that valid range was between 1 and 4,000, and I

73
03:08.790 --> 03:09.360
believe

74
03:09.360 --> 03:11.200
it's 95 as a VLAN range.

75
03:11.200 --> 03:13.960
A little bit rusty on my VLANs, but I do believe that's the case.

76
03:13.960 --> 03:18.540
Now, if we happen to just define a value, say, for example, VLAN 19 as a string

77
03:18.540 --> 03:19.120
, then we

78
03:19.120 --> 03:22.240
actually cannot perform this mathematical evaluation.

79
03:22.240 --> 03:26.510
So this is why it's important to use the correct type within our value, because

80
03:26.510 --> 03:27.000
if we happen

81
03:27.000 --> 03:31.310
to load this JSON information into our Python script, thus converting it to a
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

81
03:27.000 --> 03:31.310
to load this JSON information into our Python script, thus converting it to a

82
03:31.310 --> 03:32.240
Python object,

83
03:32.240 --> 03:35.790
we want to make sure it's going to be interpreted as in the medical value and

84
03:35.790 --> 03:36.840
integer value.

85
03:36.840 --> 03:41.560
OK, so we have strings, we have numbers, what other data types are available to

86
03:41.560 --> 03:41.960
us?

87
03:41.960 --> 03:46.300
Well, we can utilize a billion value, and this just means either a true or

88
03:46.300 --> 03:47.520
false value,

89
03:47.520 --> 03:51.560
which is once again, really good for utilizing conditional logic.

90
03:51.560 --> 03:53.440
This ultimately here is a binary value.

91
03:53.440 --> 03:56.080
So say, for example, you've got an interface configured.

92
03:56.080 --> 03:59.920
Well, is that interface in the upstate where you could have that be true?

93
03:59.920 --> 04:03.600
Or if it's in the downstate, you could have that value be false.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

93
03:59.920 --> 04:03.600
Or if it's in the downstate, you could have that value be false.

94
04:03.600 --> 04:06.600
There is no 45% on or 30% off.

95
04:06.600 --> 04:08.280
It's either on or it's off.

96
04:08.280 --> 04:11.480
The Boolean data type allows us to specify this.

97
04:11.480 --> 04:15.760
Now, the next value we can have is one known as the null data type.

98
04:15.760 --> 04:20.560
Pretty much all null means is as it sounds, it is an empty data type that is

99
04:20.560 --> 04:21.160
just there

100
04:21.160 --> 04:24.920
to represent nothing but rather than just leaving a blank space.

101
04:24.920 --> 04:29.160
Instead, we can explicitly represent this with this null value.

102
04:29.160 --> 04:33.840
Now, the next data type that we can have as a value is one known as an object.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

102
04:29.160 --> 04:33.840
Now, the next data type that we can have as a value is one known as an object.

103
04:33.840 --> 04:36.760
Now, this really is just another JSON object with them.

104
04:36.760 --> 04:41.260
Pretty much if we want to have some type of nested JSON, then we can just layer

105
04:41.260 --> 04:41.720
objects

106
04:41.720 --> 04:42.720
with an object.

107
04:42.720 --> 04:46.120
Now, the way we happen to define an object within JSON is pretty much how we

108
04:46.120 --> 04:46.800
would define

109
04:46.800 --> 04:48.120
a dictionary in Python.

110
04:48.120 --> 04:51.040
It's going to be utilizing these curly braces here, which are really bad.

111
04:51.040 --> 04:52.360
They're drawing them immediately.

112
04:52.360 --> 04:54.480
But that is what it's supposed to be, a curly brace.

113
04:54.480 --> 04:58.000
And similarly, we also have the other data type known as an array.

114
04:58.000 --> 05:02.280
This is a kind of analogous to a list object in Python once again we use our
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

114
04:58.000 --> 05:02.280
This is a kind of analogous to a list object in Python once again we use our

115
05:02.280 --> 05:03.640
square brackets.

116
05:03.640 --> 05:07.400
And just like a list, it is used to denote multiple values.

117
05:07.400 --> 05:11.200
Pretty much so we can have multiple instances of the same type of keys.

118
05:11.200 --> 05:15.700
Now, with respect to the actual keys itself that we use, these keys absolutely

119
05:15.700 --> 05:16.200
without

120
05:16.200 --> 05:18.320
doubt must be string values.

121
05:18.320 --> 05:20.320
So we can't use a number for a key.

122
05:20.320 --> 05:22.880
We can't use a billion for a key, that type of thing.

123
05:22.880 --> 05:24.120
They must be a string.

124
05:24.120 --> 05:25.440
And this is very, very important.

125
05:25.440 --> 05:29.900
When we define these keys as strings, we cannot just be using single quotation

126
05:29.900 --> 05:30.400
marks.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

126
05:29.900 --> 05:30.400
marks.

127
05:30.400 --> 05:34.320
OK, you must use double quotations for this to be valid.

128
05:34.320 --> 05:37.600
So let me just go and show you some examples of working with JSON.

129
05:37.600 --> 05:41.870
So what we'll do here is I'll just say touch and let's just recall this VLAN

130
05:41.870 --> 05:42.240
data and

131
05:42.240 --> 05:44.080
give it a dot JSON extension.

132
05:44.080 --> 05:45.080
So let's open this up here.

133
05:45.080 --> 05:47.320
All right, so all I've done is paste in this information.

134
05:47.320 --> 05:52.320
What we have here is some JSON data representing our VLAN configurations.

135
05:52.320 --> 05:56.560
And like I say, looking at this, this might look suspiciously like Python.

136
05:56.560 --> 06:00.350
And quite honestly, there are a lot of similarities, but notice that this is
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

136
05:56.560 --> 06:00.350
And quite honestly, there are a lot of similarities, but notice that this is

137
06:00.350 --> 06:01.320
fairly human readable.

138
06:01.320 --> 06:03.280
You can probably interpret what this is.

139
06:03.280 --> 06:04.280
So look at the very top.

140
06:04.280 --> 06:07.320
We have our curly brace, the note in a JSON object.

141
06:07.320 --> 06:11.040
And here is the corresponding closing curly brace right here down the bottom.

142
06:11.040 --> 06:15.360
Now inside of that, we have our opening key, which is VLAN's notice.

143
06:15.360 --> 06:19.760
It is a string value as are all the keys and they're all in case within double

144
06:19.760 --> 06:20.080
quotation

145
06:20.080 --> 06:21.080
marks.

146
06:21.080 --> 06:23.520
We just zoom in so you can see this a little bit better.

147
06:23.520 --> 06:27.320
Okay, so let's go and say I changed the key to remove the quotation marks.

148
06:27.320 --> 06:28.320
Look at this right here.

149
06:28.320 --> 06:30.320
See this little red squiggly line.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

149
06:28.320 --> 06:30.320
See this little red squiggly line.

150
06:30.320 --> 06:32.680
This is actually telling us we have an error.

151
06:32.680 --> 06:36.480
If I hover over it, property keys must be double quoted.

152
06:36.480 --> 06:41.720
So even if I happen to do this and this, we still have an error.

153
06:41.720 --> 06:45.640
We really have to make sure that we're utilizing these double quotes for these

154
06:45.640 --> 06:46.160
keys.

155
06:46.160 --> 06:49.910
Now inside here, we actually have an array object very similar to what we call

156
06:49.910 --> 06:50.360
a list

157
06:50.360 --> 06:51.680
in Python.

158
06:51.680 --> 06:55.720
This allows us to specify multiple instances of the same object.

159
06:55.720 --> 07:00.320
So inside this array object right here, look at the blue color braces inside,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

159
06:55.720 --> 07:00.320
So inside this array object right here, look at the blue color braces inside,

160
07:00.320 --> 07:00.720
we actually

161
07:00.720 --> 07:03.040
have this other JSON object.

162
07:03.040 --> 07:06.080
In fact, we've actually got another JSON object within this as well.

163
07:06.080 --> 07:10.660
Okay, now the crucial thing to note here, why do we actually need this array

164
07:10.660 --> 07:11.400
object?

165
07:11.400 --> 07:14.900
Well, this is because we have another rule within JSON is that we cannot

166
07:14.900 --> 07:15.840
actually duplicate

167
07:15.840 --> 07:16.840
keys.

168
07:16.840 --> 07:20.160
Now, just to be clear here, I'm not talking about never having the same key in

169
07:20.160 --> 07:20.240
the

170
07:20.240 --> 07:22.000
entire JSON document.

171
07:22.000 --> 07:25.030
This is obviously not true because look at this right here, we have a name key

172
07:25.030 --> 07:25.720
right here

173
07:25.720 --> 07:27.040
and then a name key right here.

174
07:27.040 --> 07:29.960
I'm talking about the same keys within the same JSON objects.

175
07:29.960 --> 07:34.330
So say, for example, in this object right here, if I added a new key right here
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

175
07:29.960 --> 07:34.330
So say, for example, in this object right here, if I added a new key right here

176
07:34.330 --> 07:34.920
, such as

177
07:34.920 --> 07:39.380
name and called this maybe HR for human resources, now we're going to have a

178
07:39.380 --> 07:40.320
duplication and this

179
07:40.320 --> 07:44.120
is now going to be a problem, whereas when we happen to have a JSON object like

180
07:44.120 --> 07:44.800
this

181
07:44.800 --> 07:49.510
and we put it within an array, we're actually allowing multiple JSON objects of

182
07:49.510 --> 07:49.760
the same

183
07:49.760 --> 07:50.760
structure.

184
07:50.760 --> 07:53.790
So realistically, if we have a type of data that we want to effectively model

185
07:53.790 --> 07:54.920
right here,

186
07:54.920 --> 07:58.430
such as a name, a number and SVI, that type of thing and we want to have more

187
07:58.430 --> 07:59.080
than one

188
07:59.080 --> 08:02.760
of these objects, then we want to wrap the entire thing within an array.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

188
07:59.080 --> 08:02.760
of these objects, then we want to wrap the entire thing within an array.

189
08:02.760 --> 08:03.760
This is why we do it.

190
08:03.760 --> 08:07.100
To say, for example, I remove the array, delete there, as well as a closing

191
08:07.100 --> 08:07.720
brace right

192
08:07.720 --> 08:08.720
here.

193
08:08.720 --> 08:11.490
If I happen to save this, look what actually happens down here, we're now

194
08:11.490 --> 08:12.080
beginning to

195
08:12.080 --> 08:13.280
see these errors appear.

196
08:13.280 --> 08:15.560
This is no longer valid JSON.

197
08:15.560 --> 08:18.200
So let me just put this back and we're now back to working JSON.

198
08:18.200 --> 08:22.510
So as we can see, we have this data structure here, VLANs, and inside of this,

199
08:22.510 --> 08:23.320
what we have

200
08:23.320 --> 08:25.080
are three instances.

201
08:25.080 --> 08:28.660
The instance in position zero is the first VLAN, which we can see right here,

202
08:28.660 --> 08:29.140
the mark

203
08:29.140 --> 08:30.840
into one with number 10.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

203
08:29.140 --> 08:30.840
into one with number 10.

204
08:30.840 --> 08:34.760
Inside of that, we have a switched virtual interface, another JSON object.

205
08:34.760 --> 08:39.120
We can open this up, expand this, see the IP address as well as a subnet mask.

206
08:39.120 --> 08:42.520
If we go back, let's go to the second object right here.

207
08:42.520 --> 08:44.960
Again, we can see the name is sales number 20.

208
08:44.960 --> 08:48.870
We have a JSON object within the SVI, we can see this as the IP address and sub

209
08:48.870 --> 08:49.560
net mask.

210
08:49.560 --> 08:53.450
And then finally, we can also see the third instance of the JSON object right

211
08:53.450 --> 08:53.840
here.

212
08:53.840 --> 08:58.960
Once again, finance number is 30 SVI, here is information right here.

213
08:58.960 --> 09:02.630
So actually, as in this nice hierarchical structure, as you can see right there
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

213
08:58.960 --> 09:02.630
So actually, as in this nice hierarchical structure, as you can see right there

214
09:02.630 --> 09:02.880
, now one

215
09:02.880 --> 09:06.800
thing to note, if you're coming from YAML, you know YAML is super human

216
09:06.800 --> 09:07.640
readable.

217
09:07.640 --> 09:12.340
It's very, very nice on the eyes, but it's also very sensitive to indentation

218
09:12.340 --> 09:12.720
and white

219
09:12.720 --> 09:13.720
space.

220
09:13.720 --> 09:17.070
It might be somewhat of a relief for you to learn that when you're working with

221
09:17.070 --> 09:17.480
JSON,

222
09:17.480 --> 09:21.920
white space and indentation, absolutely does not matter a jot.

223
09:21.920 --> 09:25.350
Really has no effect at all, so what you can do is if you so wish, you can just

224
09:25.350 --> 09:25.760
go and

225
09:25.760 --> 09:30.840
make this look all weird and wonderful by messing with the actual indentation,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

225
09:25.760 --> 09:30.840
make this look all weird and wonderful by messing with the actual indentation,

226
09:30.840 --> 09:31.160
add a

227
09:31.160 --> 09:32.160
lot of white space here.

228
09:32.160 --> 09:36.000
So if I was going to make this look really, really ugly, like so, let me zoom

229
09:36.000 --> 09:36.600
out a little

230
09:36.600 --> 09:37.600
bit.

231
09:37.600 --> 09:40.370
So you can see this all looks a little bit dodgy, but if I happen to take all

232
09:40.370 --> 09:41.120
this information

233
09:41.120 --> 09:42.680
right here, copy it.

234
09:42.680 --> 09:47.190
If I search for something called JSONLint, which is an online JSON validator,

235
09:47.190 --> 09:48.640
if I go here

236
09:48.640 --> 09:52.350
and I paste in, well, this rather ugly looking data, if I validate it, it does

237
09:52.350 --> 09:53.080
actually say

238
09:53.080 --> 09:54.800
the JSON is indeed valid.

239
09:54.800 --> 09:55.800
See that?

240
09:55.800 --> 09:58.510
And what the Lunter actually does here are automatically reformats it to make

241
09:58.510 --> 09:58.920
it look a

242
09:58.920 --> 10:00.040
little bit neater.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

242
09:58.920 --> 10:00.040
little bit neater.

243
10:00.040 --> 10:03.060
But the point is, is that the data here as presented is still valid and

244
10:03.060 --> 10:03.960
understandable,

245
10:03.960 --> 10:05.360
it's still intelligible.

246
10:05.360 --> 10:08.190
Now one big thing to really note about JSON, and this is something that is

247
10:08.190 --> 10:08.840
really, really

248
10:08.840 --> 10:13.080
worth remembering, okay, let me just save this here to get the reformatting.

249
10:13.080 --> 10:17.030
When it comes to our JSON objects, they're going to be separated via commas,

250
10:17.030 --> 10:17.720
but, and this

251
10:17.720 --> 10:22.480
is the thing to remember, we are not allowed to have any trailing commas.

252
10:22.480 --> 10:25.440
So that means the last object must not actually have a comma.

253
10:25.440 --> 10:30.040
So look at a straight here, okay, within our array, we have three JSON objects.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

253
10:25.440 --> 10:30.040
So look at a straight here, okay, within our array, we have three JSON objects.

254
10:30.040 --> 10:31.760
Just look at the blue curly braces.

255
10:31.760 --> 10:35.600
Here is the first one, and then we have a little comma right here, and then we

256
10:35.600 --> 10:36.120
have the

257
10:36.120 --> 10:40.710
next object right here, and then right next to it we have another comma, and

258
10:40.710 --> 10:41.360
then we come

259
10:41.360 --> 10:43.720
to the last JSON object within this array.

260
10:43.720 --> 10:47.020
So let me just zoom down a little bit, so let me just scroll down a little bit,

261
10:47.020 --> 10:47.320
and here

262
10:47.320 --> 10:48.920
it is right here, see this.

263
10:48.920 --> 10:52.730
Now you'll notice because this is the last object in the array, we actually do

264
10:52.730 --> 10:53.440
not have a

265
10:53.440 --> 10:56.690
comma right after this, because that would be a trailing comma and that would

266
10:56.690 --> 10:57.200
invalidate

267
10:57.200 --> 10:58.200
the JSON.

268
10:58.200 --> 11:01.700
Similarly, we also have this top level JSON object, which basically encaps
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

268
10:58.200 --> 11:01.700
Similarly, we also have this top level JSON object, which basically encaps

269
11:01.700 --> 11:02.560
ulates absolutely

270
11:02.560 --> 11:04.640
everything, and just zoom it a little bit.

271
11:04.640 --> 11:05.640
Here it is right here.

272
11:05.640 --> 11:09.680
And notice this one here also does not have a trailing comma at the end.

273
11:09.680 --> 11:12.880
So if I wanted to make the data invalid, what I could do is get down to the

274
11:12.880 --> 11:13.440
last one right

275
11:13.440 --> 11:15.560
here, add a trailing comma.

276
11:15.560 --> 11:18.160
As we can see here, I have my red squiggly line.

277
11:18.160 --> 11:21.650
If I go over it, it says here, this is a trailing comma, so I must get rid of

278
11:21.650 --> 11:22.400
it, so remove

279
11:22.400 --> 11:23.400
here.

280
11:23.400 --> 11:28.400
If I try it right here, and hit a comma, again, this is a red squiggly line.

281
11:28.400 --> 11:30.560
Once again, we have invalidated our JSON.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

281
11:28.400 --> 11:30.560
Once again, we have invalidated our JSON.

282
11:30.560 --> 11:33.910
So really just understand that with respect to JSON, whilst it was derived from

283
11:33.910 --> 11:34.480
JavaScript

284
11:34.480 --> 11:38.320
object notation, it is still absolutely language neutral.

285
11:38.320 --> 11:41.320
It can look very, very similar to Python, but it does have very particular

286
11:41.320 --> 11:42.480
strict rules about

287
11:42.480 --> 11:46.160
the type of data we can save and how we structure the corresponding keys as

288
11:46.160 --> 11:47.000
well as making

289
11:47.000 --> 11:50.930
sure that when we happen to have our JSON objects, we do not want to have any

290
11:50.930 --> 11:51.480
trailing

291
11:51.480 --> 11:52.920
commas at the end.

292
11:52.920 --> 11:57.140
And also with respect to JSON, unlike things like YAML, white space and indent

293
11:57.140 --> 11:58.160
ation does not

294
11:58.160 --> 11:59.120
matter at all.
