structurize 3.5.9__tar.gz → 3.5.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. {structurize-3.5.9/structurize.egg-info → structurize-3.5.10}/PKG-INFO +1 -1
  2. {structurize-3.5.9 → structurize-3.5.10}/avrotize/_version.py +3 -3
  3. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretocpp.py +12 -2
  4. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretogo.py +9 -1
  5. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretojava.py +9 -1
  6. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretopython.py +10 -2
  7. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretorust.py +9 -1
  8. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretots.py +12 -1
  9. {structurize-3.5.9 → structurize-3.5.10/structurize.egg-info}/PKG-INFO +1 -1
  10. {structurize-3.5.9 → structurize-3.5.10}/.gitignore +0 -0
  11. {structurize-3.5.9 → structurize-3.5.10}/LICENSE +0 -0
  12. {structurize-3.5.9 → structurize-3.5.10}/MANIFEST.in +0 -0
  13. {structurize-3.5.9 → structurize-3.5.10}/README.md +0 -0
  14. {structurize-3.5.9 → structurize-3.5.10}/avrotize/__init__.py +0 -0
  15. {structurize-3.5.9 → structurize-3.5.10}/avrotize/__main__.py +0 -0
  16. {structurize-3.5.9 → structurize-3.5.10}/avrotize/asn1toavro.py +0 -0
  17. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotize.py +0 -0
  18. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotocpp.py +0 -0
  19. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotocsharp.py +0 -0
  20. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotocsv.py +0 -0
  21. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotodatapackage.py +0 -0
  22. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotodb.py +0 -0
  23. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotogo.py +0 -0
  24. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotographql.py +0 -0
  25. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotoiceberg.py +0 -0
  26. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotojava.py +0 -0
  27. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotojs.py +0 -0
  28. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotojsons.py +0 -0
  29. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotojstruct.py +0 -0
  30. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotokusto.py +0 -0
  31. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotomd.py +0 -0
  32. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotools.py +0 -0
  33. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotoparquet.py +0 -0
  34. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotoproto.py +0 -0
  35. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotopython.py +0 -0
  36. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotorust.py +0 -0
  37. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotots.py +0 -0
  38. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrototsml.py +0 -0
  39. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrotoxsd.py +0 -0
  40. {structurize-3.5.9 → structurize-3.5.10}/avrotize/avrovalidator.py +0 -0
  41. {structurize-3.5.9 → structurize-3.5.10}/avrotize/cddltostructure.py +0 -0
  42. {structurize-3.5.9 → structurize-3.5.10}/avrotize/choice_inference.py +0 -0
  43. {structurize-3.5.9 → structurize-3.5.10}/avrotize/commands.json +0 -0
  44. {structurize-3.5.9 → structurize-3.5.10}/avrotize/common.py +0 -0
  45. {structurize-3.5.9 → structurize-3.5.10}/avrotize/constants.py +0 -0
  46. {structurize-3.5.9 → structurize-3.5.10}/avrotize/csvtoavro.py +0 -0
  47. {structurize-3.5.9 → structurize-3.5.10}/avrotize/datapackagetoavro.py +0 -0
  48. {structurize-3.5.9 → structurize-3.5.10}/avrotize/dependencies/cpp/vcpkg/vcpkg.json +0 -0
  49. {structurize-3.5.9 → structurize-3.5.10}/avrotize/dependencies/typescript/node22/package.json +0 -0
  50. {structurize-3.5.9 → structurize-3.5.10}/avrotize/dependency_resolver.py +0 -0
  51. {structurize-3.5.9 → structurize-3.5.10}/avrotize/dependency_version.py +0 -0
  52. {structurize-3.5.9 → structurize-3.5.10}/avrotize/jsonstoavro.py +0 -0
  53. {structurize-3.5.9 → structurize-3.5.10}/avrotize/jsonstostructure.py +0 -0
  54. {structurize-3.5.9 → structurize-3.5.10}/avrotize/jsontoschema.py +0 -0
  55. {structurize-3.5.9 → structurize-3.5.10}/avrotize/jstructtoavro.py +0 -0
  56. {structurize-3.5.9 → structurize-3.5.10}/avrotize/kstructtoavro.py +0 -0
  57. {structurize-3.5.9 → structurize-3.5.10}/avrotize/kustotoavro.py +0 -0
  58. {structurize-3.5.9 → structurize-3.5.10}/avrotize/kustotojstruct.py +0 -0
  59. {structurize-3.5.9 → structurize-3.5.10}/avrotize/mcp_server.py +0 -0
  60. {structurize-3.5.9 → structurize-3.5.10}/avrotize/openapitostructure.py +0 -0
  61. {structurize-3.5.9 → structurize-3.5.10}/avrotize/parquettoavro.py +0 -0
  62. {structurize-3.5.9 → structurize-3.5.10}/avrotize/proto2parser.py +0 -0
  63. {structurize-3.5.9 → structurize-3.5.10}/avrotize/proto3parser.py +0 -0
  64. {structurize-3.5.9 → structurize-3.5.10}/avrotize/prototoavro.py +0 -0
  65. {structurize-3.5.9 → structurize-3.5.10}/avrotize/schema_inference.py +0 -0
  66. {structurize-3.5.9 → structurize-3.5.10}/avrotize/sqltoavro.py +0 -0
  67. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretocddl.py +0 -0
  68. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretocsharp.py +0 -0
  69. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretocsv.py +0 -0
  70. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretodatapackage.py +0 -0
  71. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretodb.py +0 -0
  72. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretographql.py +0 -0
  73. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretoiceberg.py +0 -0
  74. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretojs.py +0 -0
  75. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretojsons.py +0 -0
  76. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretokusto.py +0 -0
  77. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretomd.py +0 -0
  78. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretoproto.py +0 -0
  79. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretotsml.py +0 -0
  80. {structurize-3.5.9 → structurize-3.5.10}/avrotize/structuretoxsd.py +0 -0
  81. {structurize-3.5.9 → structurize-3.5.10}/avrotize/tmslvalidate.py +0 -0
  82. {structurize-3.5.9 → structurize-3.5.10}/avrotize/validate.py +0 -0
  83. {structurize-3.5.9 → structurize-3.5.10}/avrotize/xmltoschema.py +0 -0
  84. {structurize-3.5.9 → structurize-3.5.10}/avrotize/xsdtoavro.py +0 -0
  85. {structurize-3.5.9 → structurize-3.5.10}/build.ps1 +0 -0
  86. {structurize-3.5.9 → structurize-3.5.10}/build.sh +0 -0
  87. {structurize-3.5.9 → structurize-3.5.10}/pyproject.toml +0 -0
  88. {structurize-3.5.9 → structurize-3.5.10}/setup.cfg +0 -0
  89. {structurize-3.5.9 → structurize-3.5.10}/structurize.egg-info/SOURCES.txt +0 -0
  90. {structurize-3.5.9 → structurize-3.5.10}/structurize.egg-info/dependency_links.txt +0 -0
  91. {structurize-3.5.9 → structurize-3.5.10}/structurize.egg-info/entry_points.txt +0 -0
  92. {structurize-3.5.9 → structurize-3.5.10}/structurize.egg-info/requires.txt +0 -0
  93. {structurize-3.5.9 → structurize-3.5.10}/structurize.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: structurize
3
- Version: 3.5.9
3
+ Version: 3.5.10
4
4
  Summary: Tools to convert from and to JSON Structure from various other schema languages.
5
5
  Author-email: Clemens Vasters <clemensv@microsoft.com>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '3.5.9'
22
- __version_tuple__ = version_tuple = (3, 5, 9)
21
+ __version__ = version = '3.5.10'
22
+ __version_tuple__ = version_tuple = (3, 5, 10)
23
23
 
24
- __commit_id__ = commit_id = 'gb097b347e'
24
+ __commit_id__ = commit_id = 'g974039ac5'
@@ -295,8 +295,18 @@ class StructureToCpp:
295
295
  # Convert to C++ type
296
296
  field_type = self.convert_structure_type_to_cpp(class_name, field_name, prop_schema, schema_namespace, nullable=not is_required)
297
297
 
298
- # Get source type
299
- source_type = prop_schema.get('type', 'string') if isinstance(prop_schema, dict) and isinstance(prop_schema.get('type'), str) else 'object'
298
+ # Get source type - handle nullable unions like ["int64", "null"]
299
+ if isinstance(prop_schema, dict):
300
+ raw_type = prop_schema.get('type', 'string')
301
+ if isinstance(raw_type, str):
302
+ source_type = raw_type
303
+ elif isinstance(raw_type, list):
304
+ non_null_types = [t for t in raw_type if t != 'null']
305
+ source_type = non_null_types[0] if len(non_null_types) == 1 and isinstance(non_null_types[0], str) else 'object'
306
+ else:
307
+ source_type = 'object'
308
+ else:
309
+ source_type = 'object'
300
310
  all_field_info.append((field_name, prop_name, field_type, source_type))
301
311
  if source_type in ('int64', 'uint64', 'int128', 'uint128', 'decimal'):
302
312
  string_json_fields.append((field_name, prop_name, field_type, source_type))
@@ -329,7 +329,15 @@ class StructureToGo:
329
329
  if not is_required and not field_type.startswith('*') and not field_type.startswith('[') and not field_type.startswith('map[') and field_type != 'interface{}':
330
330
  field_type = f'*{field_type}'
331
331
 
332
- source_type = prop_schema.get('type', 'string') if isinstance(prop_schema.get('type'), str) else 'object'
332
+ # Get source type - handle nullable unions like ["int64", "null"]
333
+ raw_type = prop_schema.get('type', 'string')
334
+ if isinstance(raw_type, str):
335
+ source_type = raw_type
336
+ elif isinstance(raw_type, list):
337
+ non_null_types = [t for t in raw_type if t != 'null']
338
+ source_type = non_null_types[0] if len(non_null_types) == 1 and isinstance(non_null_types[0], str) else 'object'
339
+ else:
340
+ source_type = 'object'
333
341
  fields.append({
334
342
  'name': pascal(prop_name),
335
343
  'type': field_type,
@@ -435,7 +435,15 @@ class StructureToJava:
435
435
  prop_type = prop_type[:-1]
436
436
  const_value = self.format_const_value(const_val, prop_type)
437
437
 
438
- source_type = prop_schema.get('type', 'string') if isinstance(prop_schema.get('type'), str) else 'object'
438
+ # Get source type - handle nullable unions like ["int64", "null"]
439
+ raw_type = prop_schema.get('type', 'string')
440
+ if isinstance(raw_type, str):
441
+ source_type = raw_type
442
+ elif isinstance(raw_type, list):
443
+ non_null_types = [t for t in raw_type if t != 'null']
444
+ source_type = non_null_types[0] if len(non_null_types) == 1 and isinstance(non_null_types[0], str) else 'object'
445
+ else:
446
+ source_type = 'object'
439
447
  return {
440
448
  'name': safe_field_name,
441
449
  'original_name': prop_name,
@@ -469,8 +469,16 @@ class StructureToPython:
469
469
  if not is_required and not prop_type.startswith('typing.Optional['):
470
470
  prop_type = f'typing.Optional[{prop_type}]'
471
471
 
472
- # Get source type from structure schema
473
- source_type = prop_schema.get('type', 'string') if isinstance(prop_schema.get('type'), str) else 'object'
472
+ # Get source type from structure schema - handle nullable unions like ["int64", "null"]
473
+ raw_type = prop_schema.get('type', 'string')
474
+ if isinstance(raw_type, str):
475
+ source_type = raw_type
476
+ elif isinstance(raw_type, list):
477
+ # Extract the non-null type from a nullable union
478
+ non_null_types = [t for t in raw_type if t != 'null']
479
+ source_type = non_null_types[0] if len(non_null_types) == 1 and isinstance(non_null_types[0], str) else 'object'
480
+ else:
481
+ source_type = 'object'
474
482
 
475
483
  return {
476
484
  'name': field_name,
@@ -324,7 +324,15 @@ class StructureToRust:
324
324
 
325
325
  serde_rename = field_name != original_field_name
326
326
 
327
- source_type = prop_schema.get('type', 'string') if isinstance(prop_schema.get('type'), str) else 'object'
327
+ # Get source type - handle nullable unions like ["int64", "null"]
328
+ raw_type = prop_schema.get('type', 'string')
329
+ if isinstance(raw_type, str):
330
+ source_type = raw_type
331
+ elif isinstance(raw_type, list):
332
+ non_null_types = [t for t in raw_type if t != 'null']
333
+ source_type = non_null_types[0] if len(non_null_types) == 1 and isinstance(non_null_types[0], str) else 'object'
334
+ else:
335
+ source_type = 'object'
328
336
  fields.append({
329
337
  'original_name': original_field_name,
330
338
  'name': field_name,
@@ -342,7 +342,18 @@ class StructureToTypeScript:
342
342
  is_enum = True
343
343
  break
344
344
 
345
- source_type = prop_schema.get('type', 'string') if isinstance(prop_schema, dict) and isinstance(prop_schema.get('type'), str) else 'object'
345
+ # Get source type - handle nullable unions like ["int64", "null"]
346
+ if isinstance(prop_schema, dict):
347
+ raw_type = prop_schema.get('type', 'string')
348
+ if isinstance(raw_type, str):
349
+ source_type = raw_type
350
+ elif isinstance(raw_type, list):
351
+ non_null_types = [t for t in raw_type if t != 'null']
352
+ source_type = non_null_types[0] if len(non_null_types) == 1 and isinstance(non_null_types[0], str) else 'object'
353
+ else:
354
+ source_type = 'object'
355
+ else:
356
+ source_type = 'object'
346
357
  fields.append({
347
358
  'name': self.safe_name(prop_name),
348
359
  'original_name': prop_name,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: structurize
3
- Version: 3.5.9
3
+ Version: 3.5.10
4
4
  Summary: Tools to convert from and to JSON Structure from various other schema languages.
5
5
  Author-email: Clemens Vasters <clemensv@microsoft.com>
6
6
  Classifier: Programming Language :: Python :: 3
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes