Skip to content

Commit f380381

Browse files
committed
Fix WildApricot generated client
1 parent 46105ce commit f380381

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

WildApricot/WildApricotClient.Generated.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11416,12 +11416,22 @@ public System.Collections.Generic.IDictionary<string, object> AdditionalProperti
1141611416
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")]
1141711417
public partial class ResourceUrl
1141811418
{
11419-
[Newtonsoft.Json.JsonConstructor]
11419+
private readonly string _value;
1142011420

11421-
public ResourceUrl()
11421+
[Newtonsoft.Json.JsonConstructor]
11422+
public ResourceUrl(string s)
11423+
{
11424+
_value = s;
11425+
}
1142211426

11427+
public static implicit operator string(ResourceUrl r)
1142311428
{
11429+
return r._value;
11430+
}
1142411431

11432+
public static implicit operator ResourceUrl(string s)
11433+
{
11434+
return new ResourceUrl(s);
1142511435
}
1142611436

1142711437
private System.Collections.Generic.IDictionary<string, object>? _additionalProperties;

WildApricot/WildApricotClient.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ public partial class WildApricotClient
1717
public WildApricotClient()
1818
{
1919
// From generated
20+
BaseUrl = "https://api.wildapricot.org/v2.3";
2021
_httpClient = new HttpClient();
21-
_settings = new Lazy<JsonSerializerSettings>(CreateSerializerSettings);
22+
Initialize();
2223

2324
// Get OAuth token using key
2425
var authToken = Encoding.ASCII.GetBytes($"APIKEY:{ApiKey}");

WildApricot/nswag.nswag

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
"clientBaseClass": null,
1515
"configurationClass": null,
1616
"generateClientClasses": true,
17+
"suppressClientClassesOutput": false,
1718
"generateClientInterfaces": false,
19+
"suppressClientInterfacesOutput": false,
1820
"clientBaseInterface": null,
1921
"injectHttpClient": true,
2022
"disposeHttpClient": true,
@@ -32,6 +34,8 @@
3234
"exposeJsonSerializerSettings": false,
3335
"clientClassAccessModifier": "public",
3436
"typeAccessModifier": "public",
37+
"propertySetterAccessModifier": "",
38+
"generateNativeRecords": false,
3539
"generateContractsOutput": false,
3640
"contractsNamespace": null,
3741
"contractsOutputFilePath": null,
@@ -70,7 +74,7 @@
7074
"dictionaryInstanceType": "System.Collections.Generic.Dictionary",
7175
"arrayBaseType": "System.Collections.ObjectModel.Collection",
7276
"dictionaryBaseType": "System.Collections.Generic.Dictionary",
73-
"classStyle": "Poco",
77+
"classStyle": "Record",
7478
"jsonLibrary": "NewtonsoftJson",
7579
"generateDefaultValues": true,
7680
"generateDataAnnotations": true,
@@ -85,12 +89,9 @@
8589
"inlineNamedTuples": true,
8690
"inlineNamedAny": false,
8791
"generateDtoTypes": true,
88-
"generateOptionalPropertiesAsNullable": false,
89-
"generateNullableReferenceTypes": false,
92+
"generateOptionalPropertiesAsNullable": true,
93+
"generateNullableReferenceTypes": true,
9094
"templateDirectory": null,
91-
"typeNameGeneratorType": null,
92-
"propertyNameGeneratorType": null,
93-
"enumNameGeneratorType": null,
9495
"serviceHost": null,
9596
"serviceSchemes": null,
9697
"output": null,

0 commit comments

Comments
 (0)