File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
Assembly/Collection/PartBuilders Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ private static string BuildRequestJsonData(Type modelType)
8383
8484 private static object CreateObject ( Type modelType )
8585 {
86+ if ( modelType == typeof ( string ) )
87+ return string . Empty ;
88+
8689 if ( IsGenericList ( modelType ) )
8790 modelType = ConstructGenericListTypeFromGenericIList ( modelType ) ;
8891
@@ -113,7 +116,7 @@ private static void InitializeListsSingleEmptyValues(object model)
113116 var emptyListType = ConstructGenericListTypeFromGenericIList ( propertyInfo . PropertyType ) ;
114117
115118 var emptyList = Activator . CreateInstance ( emptyListType ) ;
116- var emptyItem = Activator . CreateInstance ( listObjectType ) ;
119+ var emptyItem = CreateObject ( listObjectType ) ;
117120
118121 emptyListType . GetMethod ( "Add" ) ! . Invoke ( emptyList , [ emptyItem ] ) ;
119122
Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## [ 2.1] - Unreleased
4+
5+ ### Fixed
6+
7+ - Exception when generating Postman collections for controller request bodies containing ` IList<string> ` properties.
8+
39## [ 2.0] - 2024-06-05
410
511### Dependencies
Original file line number Diff line number Diff line change 88 <SymbolPackageFormat >snupkg</SymbolPackageFormat >
99 <GenerateDocumentationFile >true</GenerateDocumentationFile >
1010
11- <Version >2.0 </Version >
11+ <Version >2.1-pre01 </Version >
1212
1313 <Description >Postman collection and environment generation extension for Simplify.Web</Description >
1414 <Product >Simplify</Product >
You can’t perform that action at this time.
0 commit comments