glideapps/quicktype

[BUG]: Generating from a folder of schema files gives invalid results

andrewducker opened this issue · 0 comments

Generating using the following syntax to pick up all of the json schemas in a folder produces a generated file where the results are incorrect.

Issue Type

parsing (I think)

Context (Environment, Version, Language)

Input Format: Schema
Output Language: Verified with C#, Java, and Rust

CLI, 23.0.170

Description

I have two schema files "Person" and "Product" that both reference a third file "Location".

If I generate specifying each of those files separately then I get something sensible (although see also this bug).

If I generate using the folder with them in it as an input then the results make no sense, missing properties, adding in the schema, ID, title, and description.

Input Data

BugReportGenerateFromFolder.zip

See the readme in this zip.

The results were generated with
quicktype --lang rust --src-lang schema --out generatedFromFiles.rs --src .\product.json --src .\person.json --src .\location.json
and
quicktype --lang rust --src-lang schema --out generatedFromFolder.rs --src .\
(I've tried giving the absolute path rather than a relative one - no change)

Expected Behaviour / Output

The results from generating a folder with json schemas in it should be identical to specifying each of those schemas separately.

Steps to Reproduce

Unzip the example files.
Run the two commands.
Do a file compare on the two generated files.