glideapps / glideapps/quicktype

[BUG]: alphabetizeProperties option does not work

Open
#2,698 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

## Issue Type

issue with quicktype output

## Context (Environment, Version, Language)

Input Format: json schema
Output Language: typescript

CLI, npm, or app.quicktype.io:
Version: quicktype-core@18.0.15

## Description

option: `alphabetizeProperties: false` does not work

## Input Data

## Expected Behaviour / Output

The output properties should be ordered by properties order in schama

## Current Behaviour / Output

The output properties are ordered by alphabet order

## Steps to Reproduce

```
async function quicktypeJSONSchema(targetLanguage: string, typeName: string, jsonSchemaString: string) {
const schemaInput = new JSONSchemaInput(new FetchingJSONSchemaStore());

// We could add multiple schemas for multiple types,
// but here we're just making one type from JSON schema.
await schemaInput.addSource({ name: typeName, schema: jsonSchemaString });

const inputData = new InputData();
inputData.addInput(schemaInput);

return await quicktype({
inputData,
lang: targetLanguage,
allPropertiesOptional: false,
alphabetizeProperties: false,
rendererOptions: {
preferUnions: true,
preferConstValues: true,
}
});
}
```

## Possible Solution

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.