Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapping up interceptors, fixing typos, removing Moq #2141

Merged
merged 25 commits into from
Apr 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d81d8ac
Wrapping up interceptors, fixing typos, removing Moq
alexeyzimarev Sep 14, 2023
b2500c2
Add Linux runner, and publish tests results from Linux
alexeyzimarev Sep 15, 2023
8fd9767
A bit of cleanup and adding package versions for source gen
alexeyzimarev Sep 15, 2023
121bf93
Add missing version
alexeyzimarev Sep 15, 2023
4a40bcd
Fixed centralized package versions
alexeyzimarev Sep 18, 2023
2bda7ee
Leave exception handling as it is
alexeyzimarev Oct 24, 2023
b582f59
Remove duplicate package version
alexeyzimarev Oct 24, 2023
95ed004
Cleanup
alexeyzimarev Apr 2, 2024
f6be96c
Merge branch 'refs/heads/dev' into wrapping-up-interceptors
alexeyzimarev Apr 2, 2024
78d7d0b
Fix the readme issue
alexeyzimarev Apr 2, 2024
74970c2
- Added compatibility interceptor
alexeyzimarev Apr 2, 2024
7d8f957
Add permissions to publish test results
alexeyzimarev Apr 2, 2024
56a1161
Refactoring tests to WireMock
alexeyzimarev Apr 3, 2024
3165eaf
Allow body for GET and HEAD in tests
alexeyzimarev Apr 3, 2024
3e09a51
Cleaning up fixtures
alexeyzimarev Apr 3, 2024
f7f689e
Fix the download test
alexeyzimarev Apr 3, 2024
1b11eb2
Disable NTML tests on Linux
alexeyzimarev Apr 3, 2024
8446276
Add matrix
alexeyzimarev Apr 3, 2024
8657a8b
Try running 472 too
alexeyzimarev Apr 3, 2024
251aee8
Refactoring tests
alexeyzimarev Apr 5, 2024
aac4921
Add .NET Framework 4.8 target
alexeyzimarev Apr 5, 2024
229550a
Add 4.8 to the matrix
alexeyzimarev Apr 5, 2024
51abdef
Fixing compilation
alexeyzimarev Apr 5, 2024
ce369ef
Content type fix
alexeyzimarev Apr 5, 2024
b80b25f
Disable non-ASCII upload test for .NET 6
alexeyzimarev Apr 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix the readme issue
alexeyzimarev committed Apr 2, 2024
commit 78d7d0bebf119b1806b0b01753d936f5be4b1c16
28 changes: 27 additions & 1 deletion docs/serialization.md
Original file line number Diff line number Diff line change
@@ -37,7 +37,10 @@ In previous versions of RestSharp, the default XML serializer was a custom RestS
You can add it back if necessary by installing the package and adding it to the client:

```csharp
client.UseXmlSerializer();
var client = new RestClient(
options,
configureSerialization: s => s.UseXmlSerializer()
);
```

As before, you can supply three optional arguments for a custom namespace, custom root element, and if you want to use `SerializeAs` and `DeserializeAs` attributed.
@@ -77,6 +80,29 @@ JsonSerializerSettings DefaultSettings = new JsonSerializerSettings {
If you need to use different settings, you can supply your instance of
`JsonSerializerSettings` as a parameter for the extension method.

## CSV

A separate package `RestSharp.Serializers.CsvHelper` provides a CSV serializer for RestSharp. It is based on the
`CsvHelper` library.

Use the extension method provided by the package to configure the client:

```csharp
var client = new RestClient(
options,
configureSerialization: s => s.UseCsvHelper()
);
```

You can also supply your instance of `CsvConfiguration` as a parameter for the extension method.

```csharp
var client = new RestClient(
options,
configureSerialization: s => s.UseCsvHelper(new CsvConfiguration(CultureInfo.InvariantCulture) {...})
);
```

## Custom

You can also implement your custom serializer. To support both serialization and
2 changes: 2 additions & 0 deletions src/RestSharp.Serializers.CsvHelper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# About

Original file line number Diff line number Diff line change
@@ -8,4 +8,7 @@
<ItemGroup>
<Using Remove="System.Net.Http"/>
</ItemGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
19 changes: 19 additions & 0 deletions src/RestSharp.Serializers.NewtonsoftJson/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# About

This library allows using Newtonsoft.Json as a serializer for RestSharp instead of the default JSON serializer based
on `System.Text.Json`.

# How to use

The default JSON serializer uses `System.Text.Json`, which is a part of .NET since .NET 6.

If you want to use Newtonsoft.Json, you can install the `RestSharp.Serializers.NewtonsoftJson` package and configure
the
client to use it:

```csharp
var client = new RestClient(
options,
configureSerialization: s => s.UseNewtonsoftJson()
);
```
Original file line number Diff line number Diff line change
@@ -9,4 +9,7 @@
<Using Include="Newtonsoft.Json"/>
<Using Remove="System.Net.Http"/>
</ItemGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
22 changes: 22 additions & 0 deletions src/RestSharp.Serializers.Xml/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# About

This package is a custom XML serializer for RestSharp. It is based on the original XML serializer that was part of RestSharp but was removed in version 107.0.0.

# How to use

The default XML serializer in RestSharp is `DotNetXmlSerializer`, which uses `System.Xml.Serialization` library from .
NET.

In previous versions of RestSharp, the default XML serializer was a custom RestSharp XML serializer. To make the
code library size smaller, the custom serializer was removed from RestSharp.

You can add it back if necessary by installing the `RestSharp.Serializers.Xml` package and adding it to the client:

```csharp
var client = new RestClient(
options,
configureSerialization: s => s.UseXmlSerializer()
);
```

As before, you can supply three optional arguments for a custom namespace, custom root element, and if you want to use `SerializeAs` and `DeserializeAs` attributed.
Original file line number Diff line number Diff line change
@@ -8,4 +8,7 @@
<ItemGroup>
<Using Remove="System.Net.Http"/>
</ItemGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
Loading