`title` in property should means a short description
Hello, @bcherny, thank you for package 🙂 i use it and stumbled a mirror bug with title inside property. Currently title in property means name of property but in json schema draft it should means a short description. And also when i try add none english title i get a NoName alias for primitive.
this is a little snippet for reproduce behavior
const json2ts = require('json-schema-to-typescript');
const fs = require('fs');
const inputData = {
"title": "Example Schema",
"type": "object",
"properties": {
"lastName": {
"title": "Бла-бла-бла",
"type": "string"
},
},
"additionalProperties": false,
"required": ["firstName", "lastName"]
};
(async function example() {
const compiledModels = await json2ts.compile(inputData, '');
fs.writeFileSync(`output.ts`, compiledModels);
})();
and after invoked i got this:
export type NoName = string;
export interface ExampleSchema {
lastName: NoName;
}
but expect output like this:
export interface ExampleSchema {
/**
* Бла-бла-бла
*/
lastName: string;
}
yeah, i know that i can use description to add description of property and it works how i want, but i need properly title behavior because i use it for transform Swagger.
if you agree with me i can try to fix it myself, thank you 🙂
Hey there! This would be a backwards-incompatible change. Let's leave this issue open to collect feedback from others -- if there's enough demand, we can change the behavior.
Hey, i run also in the same issue, i need also the title for swagger. Would be good to have a option to change the title behaviour
Can't this be an option? That way backwards compatibility can be preserved