-
Notifications
You must be signed in to change notification settings - Fork 49
/
messages.dart
101 lines (77 loc) · 2.02 KB
/
messages.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
part of test_api;
class RecursiveMessage1 {
String message;
RecursiveMessage1 item;
}
class RecursiveMessage2 {
String message;
RecursiveMessage3 item;
}
class RecursiveMessage3 {
String message;
RecursiveMessage2 item;
}
class TestMessage1 {
int count;
String message;
double value;
bool check;
DateTime date;
List<String> messages;
TestMessage2 submessage;
List<TestMessage2> submessages;
@ApiProperty(
values: const {'test1': 'test1', 'test2': 'test2', 'test3': 'test3'})
String enumValue;
@ApiProperty(defaultValue: 10)
int defaultValue;
@ApiProperty(minValue: 10, maxValue: 100)
int limit;
TestMessage1();
}
class TestMessage2 {
int count;
}
class TestMessage3 {
@ApiProperty(format: 'int64')
BigInt count64;
@ApiProperty(format: 'uint64')
BigInt count64u;
@ApiProperty(format: 'int32')
int count32;
@ApiProperty(format: 'uint32')
int count32u;
}
class TestMessage4 {
@ApiProperty(required: true)
int requiredValue;
int count;
}
class TestMessage5 {
@ApiProperty(name: 'myStrings')
List<String> listOfStrings;
List<TestMessage2> listOfObjects;
Map<String, String> mapStringToString;
Map<String, TestMessage2> mapStringToObject;
}
class WrongSchema1 {
WrongSchema1.myConstructor();
}
// WrongSchema2 refers to two different classes with the same name, but residing
// in different libraries. This is not allowed.
class WrongSchema2 {
TestMessage2 firstTestMessage2;
messages2.TestMessage2 secondTestMessage2;
}
// WrongSchema3 refers indirectly (nesting) to two different classes with the
// same name, but residing in different libraries. This is not allowed.
class WrongSchema3 {
TestMessage2 firstTestMessage2;
NestedSchema nestedSchemaWithOtherTestMessage2;
}
class NestedSchema {
messages2.TestMessage2 otherTestMessage2;
}