glideapps / glideapps/quicktype

How to *not* "Detect integers in strings" when using quicktype as a library

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

Description

I am using `quicktype-core` as a library in my app.

My code looks like:
```
const qtInputData = new InputData();
const qtData = { name: 'SomeName', samples: [jsonString] }
const qtMagic = () => jsonInputForTargetLanguage(new JSONSchemaTargetLanguage(), undefined, false)
qtInputData.addSourceSync("json", qtData, qtMagic)
const qtResult = quicktypeMultiFileSync({
lang: new JSONSchemaTargetLanguage(),
inputData: qtInputData

});

const schema = combineRenderResults(qtResult).lines.join('')
```

Downstream I have a few consumers of the schema. None of them understand `{"type": "string", "format": "integer"}`.

How can I stop quicktype from detecting integers in strings?

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.