glideapps / glideapps/quicktype

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

Open
#2,634 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
13.9k
Forks
1.2k
Avg merge
8h 53m
Merged PRs (30d)
369

Description

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](https://github.com/glideapps/quicktype/issues/2633)).

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](https://github.com/user-attachments/files/16281634/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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.