You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with JSON payloads for which the schema provided by the spec is massive and kind of vague in a lot of places. So, I wanted to derive my own schema from a large sample of actual payloads and attempted to use QuickType to achieve that.
As described in the context, I have many JSON files and want to derive a common schema that strictly applies to and validates all of them. This means elements may vary widely within themselves, but the goal being that the schema applies because it's based on a massive sample of real data.
Current Behaviour / Output
What I got was a very very wide schema with many, many simpler types with randomized names. Where the source spec defines a Folder type, I'm getting schema types like Folder813 and PurpleFolder and RamshackleFolder, obviously cases where the tool determined "these are named the same thing, but look so wildly different" and did its own naming from there on. It's an understandable decision to make, but I'd love to have a flag that forces it to never do that.
Proposed Behaviour / Output
What I had hope for was that I'd provide the tool with a folder of files (or, alternatively, one massive file with {"data":[(members...)]}, as the many files proved to run suuuuuper slowly) and that it would ultimately produce one grand unified schema where, okay, each element CAN be a wide range of things, but at least it's based entirely on what's been actually observed. I expected a very deep schema of relatively few but complex top-level compound types.
Solution
The help menu suggests there's no controls for how to output schema files, and I'd like to suggest that one be added with a flag along the lines of --[no-]forcibly-combine-types-by-name. Default can be no-, so long as the flag exists for me.
Alternatives
The alternative is my own purpose-build schema parser, or the manual plodding around and use of JSONpath to get a sense of what an element actually looks like in the real world. Doable, but QuickType is so close to being my next-level solution.
The text was updated successfully, but these errors were encountered:
jwarner112
changed the title
[FEATURE]: Option to NOT forcibly combine same-name elements
[FEATURE]: Option to forcibly combine elements of the same name even if dissimilar
Feb 4, 2025
Context (Input, Language)
I'm working with JSON payloads for which the schema provided by the spec is massive and kind of vague in a lot of places. So, I wanted to derive my own schema from a large sample of actual payloads and attempted to use QuickType to achieve that.
Input Format: JSON (one file, or multiple tiles)
Output Language: JSON Schema
Description
As described in the context, I have many JSON files and want to derive a common schema that strictly applies to and validates all of them. This means elements may vary widely within themselves, but the goal being that the schema applies because it's based on a massive sample of real data.
Current Behaviour / Output
What I got was a very very wide schema with many, many simpler types with randomized names. Where the source spec defines a
Folder
type, I'm getting schema types likeFolder813
andPurpleFolder
andRamshackleFolder
, obviously cases where the tool determined "these are named the same thing, but look so wildly different" and did its own naming from there on. It's an understandable decision to make, but I'd love to have a flag that forces it to never do that.Proposed Behaviour / Output
What I had hope for was that I'd provide the tool with a folder of files (or, alternatively, one massive file with
{"data":[(members...)]}
, as the many files proved to run suuuuuper slowly) and that it would ultimately produce one grand unified schema where, okay, each element CAN be a wide range of things, but at least it's based entirely on what's been actually observed. I expected a very deep schema of relatively few but complex top-level compound types.Solution
The help menu suggests there's no controls for how to output schema files, and I'd like to suggest that one be added with a flag along the lines of
--[no-]forcibly-combine-types-by-name
. Default can beno-
, so long as the flag exists for me.Alternatives
The alternative is my own purpose-build schema parser, or the manual plodding around and use of JSONpath to get a sense of what an element actually looks like in the real world. Doable, but QuickType is so close to being my next-level solution.
The text was updated successfully, but these errors were encountered: