structurize 3.7.2__tar.gz → 3.7.3__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.
- {structurize-3.7.2/structurize.egg-info → structurize-3.7.3}/PKG-INFO +1 -1
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/_version.py +3 -3
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotojstruct.py +12 -3
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretographql.py +18 -0
- {structurize-3.7.2 → structurize-3.7.3/structurize.egg-info}/PKG-INFO +1 -1
- {structurize-3.7.2 → structurize-3.7.3}/.gitignore +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/LICENSE +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/MANIFEST.in +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/README.md +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/__init__.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/__main__.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/asn1toavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotize.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotocapnproto.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotocpp.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotocsharp.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotocsv.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotocue.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotodatapackage.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotodb.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotoflatbuffers.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotogo.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotographql.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotoiceberg.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotojava.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotojs.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotojsons.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotojtd.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotokusto.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotomd.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotools.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotoparquet.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotoproto.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotopython.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotoraml.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotorust.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotosmithy.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotosurreal.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotothrift.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotots.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrototsml.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrotoxsd.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/avrovalidator.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/capnprototoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/cddltostructure.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/choice_inference.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/commands.json +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/common.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/constants.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/csvtoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/cuetoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/cuetostructure.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/datapackagetoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/dependencies/cpp/vcpkg/vcpkg.json +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/dependencies/typescript/node22/package.json +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/dependency_resolver.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/dependency_version.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/flatbufferstoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/flatbufferstojstruct.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/jsonstoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/jsonstostructure.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/jsontoschema.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/jstructtoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/jstructtoflatbuffers.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/jstructtoraml.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/jstructtosmithy.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/jtdtoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/jtdtostructure.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/kstructtoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/kustotoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/kustotojstruct.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/mcp_server.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/openapitostructure.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/parquettoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/proto2parser.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/proto3parser.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/prototoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/ramltoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/ramltojstruct.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/schema_inference.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/smithytoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/smithytojstruct.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/sqltoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretocddl.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretocpp.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretocsharp.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretocsv.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretocue.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretodatapackage.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretodb.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretogo.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretoiceberg.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretojava.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretojs.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretojsons.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretojtd.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretokusto.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretomd.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretoparquet.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretoproto.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretopython.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretorust.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretots.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretotsml.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/structuretoxsd.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/surrealtoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/thriftstructure.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/thrifttoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/tmslvalidate.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/validate.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/xmltoschema.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/avrotize/xsdtoavro.py +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/build.ps1 +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/build.sh +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/pyproject.toml +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/setup.cfg +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/structurize.egg-info/SOURCES.txt +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/structurize.egg-info/dependency_links.txt +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/structurize.egg-info/entry_points.txt +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/structurize.egg-info/requires.txt +0 -0
- {structurize-3.7.2 → structurize-3.7.3}/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.7.
|
|
3
|
+
Version: 3.7.3
|
|
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.7.
|
|
22
|
-
__version_tuple__ = version_tuple = (3, 7,
|
|
21
|
+
__version__ = version = '3.7.3'
|
|
22
|
+
__version_tuple__ = version_tuple = (3, 7, 3)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g4eb36ac42'
|
|
@@ -148,7 +148,11 @@ class AvroToJsonStructure:
|
|
|
148
148
|
|
|
149
149
|
resolved_field_type = self.resolve_avro_type(field_type_schema, record_fields_namespace, definitions)
|
|
150
150
|
|
|
151
|
-
if "default" in field:
|
|
151
|
+
if "default" in field and field["default"] is not None:
|
|
152
|
+
# Optionality/nullability is conveyed by absence from ``required``;
|
|
153
|
+
# a redundant ``default: null`` is meaningless in JSON Structure Core
|
|
154
|
+
# (and would decorate a non-nullable type reference), so only concrete
|
|
155
|
+
# defaults are emitted.
|
|
152
156
|
resolved_field_type["default"] = self.encode_default_value(field["default"], resolved_field_type.get("type", "unknown"))
|
|
153
157
|
|
|
154
158
|
if not self.is_nullable_union(field_type_schema):
|
|
@@ -231,7 +235,10 @@ class AvroToJsonStructure:
|
|
|
231
235
|
ref_fqn = avro_type_schema.replace(".", "/")
|
|
232
236
|
else:
|
|
233
237
|
ref_fqn = self.get_fqn(context_namespace, self.clean_name(avro_type_schema))
|
|
234
|
-
|
|
238
|
+
# JSON Structure Core requires a type reference to be the value of the
|
|
239
|
+
# ``type`` keyword (``{"type": {"$ref": ...}}``); a bare ``{"$ref": ...}``
|
|
240
|
+
# is only permitted inside a type-union array. See spec 3.3.6 / 3.7.1.
|
|
241
|
+
return {"type": {"$ref": f"#/definitions/{ref_fqn}"}}
|
|
235
242
|
|
|
236
243
|
# ------------------ UNION ----------------------------------------
|
|
237
244
|
if isinstance(avro_type_schema, list):
|
|
@@ -263,7 +270,9 @@ class AvroToJsonStructure:
|
|
|
263
270
|
self.register_definition(avro_type_schema, inline_ns, definitions)
|
|
264
271
|
ref_name = self.clean_name(avro_type_schema["name"])
|
|
265
272
|
ref_fqn = self.get_fqn(inline_ns, ref_name)
|
|
266
|
-
|
|
273
|
+
# Wrap the reference under ``type`` (see note above) so the emitted
|
|
274
|
+
# property/items/values/choice node is a valid JSON Structure schema.
|
|
275
|
+
return {"type": {"$ref": f"#/definitions/{ref_fqn}"}}
|
|
267
276
|
|
|
268
277
|
if category == "array":
|
|
269
278
|
return {
|
|
@@ -199,6 +199,19 @@ class StructureToGraphQLConverter:
|
|
|
199
199
|
# Handle type keyword
|
|
200
200
|
struct_type = schema.get('type')
|
|
201
201
|
|
|
202
|
+
# A property whose ``type`` value is itself a schema object — the JSON Structure
|
|
203
|
+
# Core canonical form for references, e.g. ``{"type": {"$ref": ...}}`` — or a union
|
|
204
|
+
# array that contains such objects. Recurse so referenced named types are discovered
|
|
205
|
+
# as dependencies BEFORE their referrer (preserving declaration order).
|
|
206
|
+
if isinstance(struct_type, dict):
|
|
207
|
+
self.extract_named_types_from_structure(struct_type, parent_namespace)
|
|
208
|
+
return
|
|
209
|
+
if isinstance(struct_type, list):
|
|
210
|
+
for member in struct_type:
|
|
211
|
+
if isinstance(member, dict):
|
|
212
|
+
self.extract_named_types_from_structure(member, parent_namespace)
|
|
213
|
+
return
|
|
214
|
+
|
|
202
215
|
if struct_type == 'object':
|
|
203
216
|
# Process nested properties FIRST to ensure dependencies come before this type
|
|
204
217
|
if 'properties' in schema and isinstance(schema['properties'], dict):
|
|
@@ -405,6 +418,11 @@ class StructureToGraphQLConverter:
|
|
|
405
418
|
if isinstance(struct_type, list):
|
|
406
419
|
return self.get_graphql_type(struct_type)
|
|
407
420
|
|
|
421
|
+
# Handle a type reference (or nested type object) that is the value of
|
|
422
|
+
# ``type`` — the JSON Structure Core canonical form ``{"type": {"$ref": ...}}``.
|
|
423
|
+
if isinstance(struct_type, dict):
|
|
424
|
+
return self.get_graphql_type(struct_type)
|
|
425
|
+
|
|
408
426
|
if struct_type == 'array':
|
|
409
427
|
items_type = self.get_graphql_type(structure_type.get('items', {'type': 'any'}))
|
|
410
428
|
return f"[{items_type}]"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: structurize
|
|
3
|
-
Version: 3.7.
|
|
3
|
+
Version: 3.7.3
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{structurize-3.7.2 → structurize-3.7.3}/avrotize/dependencies/typescript/node22/package.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|