Commit 04a0965
authored
[Schematic-294] Add pattern regex rule to jsonschemas (#1608)
* refactored DataModelJSONSchema into DataModelJSONSchema2
* refactored DataModelJSONSchema into DataModelJSONSchema2
* fix test
* added minimum, maximum, and description to schemas
* formatting changes
* ran vlack
* fix types that do not work with python3.9
* fix types that do not work with python3.9
* ran black
* added test files
* remove test files form git control
* improve test
* git rm test files
* renamed class
* improved tests
* added two componets to JSON Schema test
* added two componets to JSON Schema test
* renamed test files
* git rm test files
* component generator now uses new schema generator class
* removed description adding from component generator
* fix formatting
* added missing end of file lines
* move test files
* sonarcloud fixes
* fix types not supported in python3.9
* fix bad path
* remove uneeded test
* synapse does not allow the type keyword to be an array
* add integration test
* fix formatting
* add tests to cover missing coverage
* added title keyword to all types in an anyOf list
* regenerated expected test files
* fix end of lines
* change integration test to use Synapse fixture
* Linglings suggestions
* removed unused import
* JSON schemas not written with display name
* change schemas to not use display name
* add integration test for validation schemas in Synapse
* added json schema validation tests
* added missing docstring
* moved instances to files
* fix bug in schema generation
* fix mypy issues
* cleaned up test functionality into fixtures
* add test case
* various improvements
* integration tests now create schemas instead of using expected ones
* fixed bug where conditiuonal dependencies where using display names
* added additional schema validation tests
* fixed bug in json_files_equal
* files formatted
* improved module level docstring
* move function to method of PropertyData
* improve PropertyData docstring
* improvements to JSONSchema class
* fix argument name
* improved NodeProcessor docstring
* ran pre-commit
* fixed line in docstring
* remove uneeded function
* fix accidental commit
* fix incorrect type is test
* Add WHEN/GIVEN/THEN pattern to some tests
* ran pre-commit
* added validation rules to exception message
* added validation rules to exception message
* cleaned up comments, docstring and vareiable name
* imrpive docstring
* ran pre-commit
* Linglings suggestions
* ran pre-commit
* ran pylint
* added tests for _write_data_model
* added unit test for DataModelGraphExplorer.get_adjacent_nodes_by_relationship
* revert json_files_equal back to orginal state
* created a metadata_model fixture in conftest
* ran pre-commit
* change name of output directory, possible collision with other tests
* refactored JSONSchemaGenerator class into function
* JSONSchemaComponentGnerator now using crate_json_schema function
* ran pre-commit
* can now write using display names
* added attributes to example model
* moved functioanlity for creating nodes to the Node class
* moved functioanlity for creating nodes to the Node class
* cleaned up formatting
* remove dmr from classes
* clean up tests
* use new display names parameter
* run pre-commit
* move module-scoped synapse to conftest
* remove unused imports
* add more detail to test id
* add ids to paramatized tests
* fix malformed test ids
* ran pre-commit
* removed after yield teardowns with finalizers
* ran pre-commit
* regex validation rule is now translated to pattern keyword
* update expected file
* cleanup
* cleanup tests
* cleanup tests
* changed strings into enum classes
* moved enums and constants to constants file
* ran precommit
* handle merge
* Linglings suggestions
* moved code involving validation rules oout of pont_init and into helper function
* added test
* add pylint diable line
* ran black1 parent 15196c6 commit 04a0965
File tree
7 files changed
+383
-121
lines changed- schematic/schemas
- tests
- data
- expected_jsonschemas
- unit
7 files changed
+383
-121
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | | - | |
18 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
147 | 146 | | |
148 | 147 | | |
149 | 148 | | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | 170 | | |
174 | 171 | | |
175 | 172 | | |
| |||
193 | 190 | | |
194 | 191 | | |
195 | 192 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
200 | 200 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | 201 | | |
205 | | - | |
206 | | - | |
207 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
208 | 210 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
219 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
220 | 267 | | |
221 | | - | |
| 268 | + | |
| 269 | + | |
222 | 270 | | |
223 | 271 | | |
224 | 272 | | |
| |||
230 | 278 | | |
231 | 279 | | |
232 | 280 | | |
233 | | - | |
234 | | - | |
| 281 | + | |
| 282 | + | |
235 | 283 | | |
236 | 284 | | |
237 | 285 | | |
| |||
240 | 288 | | |
241 | 289 | | |
242 | 290 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 291 | + | |
| 292 | + | |
247 | 293 | | |
248 | 294 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 295 | + | |
253 | 296 | | |
254 | 297 | | |
255 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
256 | 301 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
263 | 308 | | |
264 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
265 | 313 | | |
266 | 314 | | |
267 | 315 | | |
| |||
279 | 327 | | |
280 | 328 | | |
281 | 329 | | |
282 | | - | |
283 | | - | |
| 330 | + | |
| 331 | + | |
284 | 332 | | |
285 | 333 | | |
286 | 334 | | |
287 | | - | |
| 335 | + | |
288 | 336 | | |
289 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
290 | 366 | | |
291 | 367 | | |
292 | 368 | | |
| |||
501 | 577 | | |
502 | 578 | | |
503 | 579 | | |
504 | | - | |
| 580 | + | |
505 | 581 | | |
506 | 582 | | |
507 | 583 | | |
| |||
539 | 615 | | |
540 | 616 | | |
541 | 617 | | |
542 | | - | |
543 | 618 | | |
544 | 619 | | |
545 | 620 | | |
| |||
640 | 715 | | |
641 | 716 | | |
642 | 717 | | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
643 | 723 | | |
644 | 724 | | |
645 | 725 | | |
| |||
832 | 912 | | |
833 | 913 | | |
834 | 914 | | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
| 915 | + | |
839 | 916 | | |
840 | 917 | | |
841 | 918 | | |
| |||
916 | 993 | | |
917 | 994 | | |
918 | 995 | | |
919 | | - | |
920 | | - | |
921 | | - | |
922 | | - | |
| 996 | + | |
923 | 997 | | |
924 | 998 | | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
0 commit comments