Skip to content

Commit 664a3d1

Browse files
committed
Schema of CodeGen.json
1 parent d804b1e commit 664a3d1

File tree

19 files changed

+598
-79
lines changed

19 files changed

+598
-79
lines changed

DemoCoreWeb/CodeGen.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "CodeGenSchema.json",
23
"ApiSelections": {
34
"ExcludedControllerNames": [
45
"DemoWebApi.Controllers.Home",

DemoCoreWeb/CodeGenSchema.json

Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
{
2+
"title": "CodeGen Meta of WebApiClientGen",
3+
"description": "POST to CodeGen controller",
4+
"definitions": {
5+
"CodeGenConfig": {
6+
"description": "Cherry picking of data models and API controllers.",
7+
"type": "object",
8+
"properties": {
9+
"ExcludedControllerNames": {
10+
"type": [
11+
"array",
12+
"null"
13+
],
14+
"items": {
15+
"type": [
16+
"string",
17+
"null"
18+
]
19+
}
20+
},
21+
"DataModelAssemblyNames": {
22+
"description": "Exclusive to DataModels.",
23+
"type": [
24+
"array",
25+
"null"
26+
],
27+
"items": {
28+
"type": [
29+
"string",
30+
"null"
31+
]
32+
}
33+
},
34+
"DataModels": {
35+
"description": "Exclusive to DataModelAssemblyNames",
36+
"type": [
37+
"array",
38+
"null"
39+
],
40+
"items": {
41+
"$ref": "#/definitions/DataModel"
42+
}
43+
},
44+
"CherryPickingMethods": {
45+
"type": "integer"
46+
},
47+
"NamespacePrefixesOfGodAssemblyTypes": {
48+
"type": [
49+
"array",
50+
"null"
51+
],
52+
"items": {
53+
"type": [
54+
"string",
55+
"null"
56+
]
57+
}
58+
},
59+
"AllDataModelAssemblyNames": {
60+
"type": [
61+
"array",
62+
"null"
63+
],
64+
"items": {
65+
"type": [
66+
"string",
67+
"null"
68+
]
69+
}
70+
}
71+
}
72+
},
73+
"CodeGenOutputs": {
74+
"description": "Options of output",
75+
"type": "object",
76+
"properties": {
77+
"ClientLibraryProjectFolderName": {
78+
"type": [
79+
"string",
80+
"null"
81+
]
82+
},
83+
"FileName": {
84+
"type": [
85+
"string",
86+
"null"
87+
]
88+
},
89+
"GenerateBothAsyncAndSync": {
90+
"type": "boolean"
91+
},
92+
"StringAsString": {
93+
"type": "boolean"
94+
},
95+
"CamelCase": {
96+
"type": "boolean"
97+
},
98+
"UseSystemTextJson": {
99+
"type": "boolean"
100+
},
101+
"ContainerNameSuffix": {
102+
"type": [
103+
"string",
104+
"null"
105+
]
106+
},
107+
"UseEnsureSuccessStatusCodeEx": {
108+
"type": "boolean"
109+
},
110+
"IncludeEnsureSuccessStatusCodeExBlock": {
111+
"type": "boolean"
112+
},
113+
"HandleHttpRequestHeaders": {
114+
"type": "boolean"
115+
},
116+
"CancellationTokenEnabled": {
117+
"type": "boolean"
118+
},
119+
"JsMethodSuffixWithClrTypeName": {
120+
"type": "boolean"
121+
},
122+
"Plugins": {
123+
"type": [
124+
"array",
125+
"null"
126+
],
127+
"items": {
128+
"$ref": "#/definitions/JSPlugin"
129+
}
130+
},
131+
"CSClientNamespaceSuffix": {
132+
"type": [
133+
"string",
134+
"null"
135+
]
136+
},
137+
"DataAnnotationsEnabled": {
138+
"type": "boolean"
139+
},
140+
"DataAnnotationsToComments": {
141+
"type": "boolean"
142+
},
143+
"DecorateDataModelWithDataContract": {
144+
"type": "boolean"
145+
},
146+
"DataContractNamespace": {
147+
"type": [
148+
"string",
149+
"null"
150+
]
151+
},
152+
"DecorateDataModelWithSerializable": {
153+
"type": "boolean"
154+
},
155+
"IEnumerableToArray": {
156+
"type": "boolean"
157+
},
158+
"NotNullAttributeOnMethod": {
159+
"type": "boolean"
160+
},
161+
"MaybeNullAttributeOnMethod": {
162+
"type": "boolean"
163+
}
164+
}
165+
},
166+
"DataModel": {
167+
"type": [
168+
"object",
169+
"null"
170+
],
171+
"properties": {
172+
"AssemblyName": {
173+
"type": [
174+
"string",
175+
"null"
176+
]
177+
},
178+
"CherryPickingMethods": {
179+
"type": "integer"
180+
},
181+
"DataAnnotationsToComments": {
182+
"type": "boolean"
183+
}
184+
}
185+
},
186+
"JSPlugin": {
187+
"type": [
188+
"object",
189+
"null"
190+
],
191+
"properties": {
192+
"AssemblyName": {
193+
"type": "string"
194+
},
195+
"TargetDir": {
196+
"type": "string"
197+
},
198+
"TSFile": {
199+
"type": [
200+
"string",
201+
"null"
202+
]
203+
},
204+
"ContentType": {
205+
"type": [
206+
"string",
207+
"null"
208+
]
209+
},
210+
"AsModule": {
211+
"type": "boolean"
212+
},
213+
"ClientNamespaceSuffix": {
214+
"type": [
215+
"string",
216+
"null"
217+
]
218+
},
219+
"ContainerNameSuffix": {
220+
"type": [
221+
"string",
222+
"null"
223+
]
224+
},
225+
"DataAnnotationsToComments": {
226+
"type": "boolean"
227+
},
228+
"HelpStrictMode": {
229+
"type": "boolean"
230+
},
231+
"NgDateOnlyFormControlEnabled": {
232+
"type": "boolean"
233+
}
234+
},
235+
"required": [
236+
"AssemblyName",
237+
"TargetDir",
238+
"AsModule"
239+
]
240+
}
241+
},
242+
"type": "object",
243+
"properties": {
244+
"ClientApiOutputs": {
245+
"$ref": "#/definitions/CodeGenOutputs"
246+
},
247+
"ApiSelections": {
248+
"$ref": "#/definitions/CodeGenConfig"
249+
}
250+
},
251+
"required": [
252+
"ClientApiOutputs",
253+
"ApiSelections"
254+
]
255+
}

DemoCoreWebControllers/Controllers/CodeGenController.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ public IActionResult TriggerCodeGen([FromBody] CodeGenSettings settings)
6060
Console.Error.WriteLine(e.Message);
6161
return StatusCode((int)HttpStatusCode.InternalServerError, e.Message);
6262
}
63-
64-
if (!settings.ClientApiOutputs.CamelCase.HasValue)
65-
{
66-
settings.ClientApiOutputs.CamelCase = true;
67-
}
6863

6964
try
7065
{

DemoGodAssemblyWeb/Controllers/CodeGenController.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ public IActionResult TriggerCodeGen([FromBody] CodeGenSettings settings)
5757
System.Diagnostics.Trace.TraceWarning(e.Message);
5858
return StatusCode((int)HttpStatusCode.InternalServerError, e.Message);
5959
}
60-
61-
if (!settings.ClientApiOutputs.CamelCase.HasValue)
62-
{
63-
settings.ClientApiOutputs.CamelCase = true;
64-
}
6560

6661
try
6762
{

DemoTextJsonWeb/CodeGen.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "CodeGenSchema.json",
23
"ApiSelections": {
34
"ExcludedControllerNames": [
45
"DemoWebApi.Controllers.Home",

0 commit comments

Comments
 (0)