Support top-level JSON primitives #5
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses the issue where
unreachable!was triggered for valid JSON files containing top-level primitives (e.g.,"hello",123).Changes:
Schematype was refactored fromenum Schema { Object, Array }tostruct Schema { ty: FieldType }, allowing it to represent any valid JSON type at the root.pub type ROOT = String;).public static class ROOT { ... }) that uses Jackson annotations (@JsonValue,@JsonCreator) to serialize/deserialize correctly as a raw primitive.top-level-*.jsonfiles totest-datacovering string, integer, float, boolean, and null types.Note: Codegen logic for Objects and Arrays remains largely unchanged, ensuring backward compatibility with existing structural schemas.
PR created automatically by Jules for task 16147890577533185797 started by @zahash