-
Notifications
You must be signed in to change notification settings - Fork 216
Open
Description
Losing properties with custom formatter
When using a custom formatter, I’m intercepting NumberType. If it’s a number, I want it to return a property "tsType": "x" along with all the original properties of that field. However, when I fetch the definition with the method
const definition = this.childTypeFormatter.getDefinition(type);the definition comes back empty.
I debugged the library and in the package ts-json-schema-generator/dist/src/CircularReferenceTypeFormatter.js I noticed that with the filled key (NumberType), the method
Object.assign(definition, this.childTypeFormatter.getDefinition(type));is triggered before the value is populated. Because of that, my formatter is called, which looks for a valid key, but it has no value yet.
Is this the expected behavior?

Metadata
Metadata
Assignees
Labels
No labels