export type JsonAttributesSource = 'Newtonsoft.Json' | 'System.Text.Json' ; function unsupportedSource ( attributesSource ) { throw new Error ( `Unsupported JSON attributes source: ${ attributesSource }` ) ; } export class JsonAttributesSourceConfiguration { readonly namespace : string ; readonly propertyAttribute : string ; readonly requiredAttribute : string ; constructor ( namespace , propertyAttribute , requiredAttribute ) { this . namespace = namespace ; this . propertyAttribute = propertyAttribute ; this . requiredAttribute = requiredAttribute ; } } const newtonsoftConfiguration = new JsonAttributesSourceConfiguration ( 'Newtonsoft.Json' , 'JsonProperty' , 'JsonRequired' ) ; const systemTextJsonConfiguration = new JsonAttributesSourceConfiguration ( 'System.Text.Json' , 'JsonPropertyName' , null ) ; export function getJsonAttributeSourceConfiguration ( attributesSource ) { switch ( attributesSource ) { case 'Newtonsoft.Json' : return newtonsoftConfiguration ; case 'System.Text.Json' : return systemTextJsonConfiguration ; } unsupportedSource ( attributesSource ) ; }