File tree Expand file tree Collapse file tree 3 files changed +101
-1
lines changed
test/programs/annotation-tjs Expand file tree Collapse file tree 3 files changed +101
-1
lines changed Original file line number Diff line number Diff line change
1
+ // All of these formats are defined in this specification: http://json-schema.org/latest/json-schema-validation.html#rfc.section.8.3
2
+ interface MyObject {
3
+ /**
4
+ * @TJS -format date-time
5
+ */
6
+ dateTime : string ;
7
+
8
+ /**
9
+ * @TJS -format email
10
+ */
11
+ email : string ;
12
+
13
+ /**
14
+ * @TJS -format hostname
15
+ */
16
+ hostname : string ;
17
+
18
+ /**
19
+ * @TJS -format ipv4
20
+ */
21
+ ipv4 : string ;
22
+
23
+ /**
24
+ * @TJS -format ipv6
25
+ */
26
+ ipv6 : string ;
27
+
28
+ /**
29
+ * @TJS -format uri
30
+ */
31
+ uri : string ;
32
+
33
+ /**
34
+ * @TJS -format uri-reference
35
+ */
36
+ uriReference : string ;
37
+
38
+ /**
39
+ * @TJS -format uri-template
40
+ */
41
+ uriTemplate : string ;
42
+
43
+ /**
44
+ * @TJS -format json-pointer
45
+ */
46
+ jsonPointer : string ;
47
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "$schema" : " http://json-schema.org/draft-04/schema#" ,
3
+ "properties" : {
4
+ "dateTime" : {
5
+ "format" : " date-time" ,
6
+ "type" : " string"
7
+ },
8
+ "email" : {
9
+ "format" : " email" ,
10
+ "type" : " string"
11
+ },
12
+ "hostname" : {
13
+ "format" : " hostname" ,
14
+ "type" : " string"
15
+ },
16
+ "ipv4" : {
17
+ "format" : " ipv4" ,
18
+ "type" : " string"
19
+ },
20
+ "ipv6" : {
21
+ "format" : " ipv6" ,
22
+ "type" : " string"
23
+ },
24
+ "jsonPointer" : {
25
+ "format" : " json-pointer" ,
26
+ "type" : " string"
27
+ },
28
+ "uri" : {
29
+ "format" : " uri" ,
30
+ "type" : " string"
31
+ },
32
+ "uriReference" : {
33
+ "format" : " uri-reference" ,
34
+ "type" : " string"
35
+ },
36
+ "uriTemplate" : {
37
+ "format" : " uri-template" ,
38
+ "type" : " string"
39
+ }
40
+ },
41
+ "required" : [
42
+ " dateTime" ,
43
+ " email" ,
44
+ " hostname" ,
45
+ " ipv4" ,
46
+ " ipv6" ,
47
+ " jsonPointer" ,
48
+ " uri" ,
49
+ " uriReference" ,
50
+ " uriTemplate"
51
+ ],
52
+ "type" : " object"
53
+ }
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import * as stringify from "json-stable-stringify";
7
7
const vm = require ( "vm" ) ;
8
8
9
9
const REGEX_FILE_NAME = / " .* " \. / ;
10
- const REGEX_TJS_JSDOC = / ^ - ( [ \w ] + ) \s ( [ \w ] + ) / g;
10
+ const REGEX_TJS_JSDOC = / ^ - ( [ \w ] + ) \s ( [ \w - ] + ) / g;
11
11
12
12
export function getDefaultArgs ( ) : Args {
13
13
return {
You can’t perform that action at this time.
0 commit comments