christianhelle / refitter

Refit Client API Generator for OpenAPI
https://refitter.github.io
MIT License
156 stars 36 forks source link

Serializer improvements #383

Closed dammitjanet closed 1 month ago

dammitjanet commented 1 month ago

Is your feature request related to a problem? Please describe. With regards to this issue raised against apicodegen https://github.com/christianhelle/apiclientcodegen/issues/906, the JsonSerializerOptions within Refiter.Core does not generate prettified Json

Describe the solution you'd like The JsonSerialzer should be capable of generating pretty json, in this case the output of a refitter file in a human readable format. the methods should take an optional JsonSerializerOptions such that the Serialise method should look like

public static string Serialize(object any, JsonSerializerOptions? options) => JsonSerializer.Serialize(any, options ?? JsonSerializerOptions);

Describe alternatives you've considered n/a

Additional context As far as I am aware, the WriteIndented JsonSerializerOptions only affects the Serialization into JSON, and does not affect reading of minified or prettified json content

christianhelle commented 1 month ago

@dammitjanet Thanks for taking the time to report this. This will be resolved soon